• Resolved fredointhecut

    (@fredointhecut)


    Hey!

    I have a little problem with menu links, so – My menu is category links. When i open the category from menu ( I took the URL links from /shop page, checked the checkboxes and took the URL that appeared) it’s just basic filter there, no checkbox checked and the subcategory dropdown is close. Is it somehow possible that when people open it from other page with the URL, it opens up with checked checkboxes and opened subcategory dropdown so people can have a better underestanding where they navigate in the filter?

    Regards,
    Fredi

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author RealMag777

    (@realmag777)

    Hello Fredi

    I want to tell you that its possible, but look here please https://epood2.surgitech.ee/shop/swoof/product_cat-glukomeetrid/ – when you open this link you see subcategories of the current selected category, and all its products, so nothing here to activate because in the filter are shown only its subcategories which are waiting for customer click. Sure you will ask why that, and why not to show parent clicked subcategory – because its already selected and imagine if user decided to uncheck it – what content in this case the plugin should show them?

    But I can suggest next – dynamic widget title:

    To dynamically change the title of the widget containing the phrase “cat_label_to_redraw” (just paste this name instead of simple text) depending on what page the user is on. Here’s how you can implement it:

    Goal: Change the widget title based on the current category page. If the widget contains the text “cat_label_to_redraw” and the user is on a category page, the title will change to the name of the current category. If the user is not on a category page, the title will be “Product Filter” (or empty, just change it in the code).

    Solution: We will use hook widget_title filter, which allows us to modify the widget title before displaying it. Depending on the condition, we will change the title to the desired value.

    add_filter('widget_title', function ($title, $instance, $id_base) {
        if (strpos($title, 'cat_label_to_redraw') !== false) {
            if (is_product_category()) {
                $current_category = get_queried_object();
                $title = esc_html($current_category->name);
            } else {
                $title = 'Product Filter';
            }
        }
    
        return $title;
    }
    , 10, 3);
    
    

    This approach allows you to flexibly adapt the widget title depending on the context, improving the user experience on your site. If you have any questions or need additional help, let me know!

    Thread Starter fredointhecut

    (@fredointhecut)

    Hey,

    I added the code but nothing changed, still if i open the category by link, it will show unchecked checkboxes and category dropdowns are closed.

    Regards,

    Fredi

    Plugin Support mediawebster

    (@mediawebster)

    Hello Fredi @fredointhecut

    Please try in file – \woocommerce-products-filter\js\front.js – add this code – https://share.pluginus.net/image/i20240823114202.png

    return false;

    Clear all cache and Ctrl+F5 and do a test

    Thread Starter fredointhecut

    (@fredointhecut)

    Hey,

    Yes, now it works perfectly when i choose the category from menu, but when im in shop page after getting category from menu or want to check another checkbox without using menu category links, it will not load the content, the “Loading” will be there forever, but if i refresh the page then it will load the checked category.

    Regards,
    Fredi

    Plugin Support mediawebster

    (@mediawebster)

    Hello Fredi

    Describe in more detail what I should do to get the error.

    I’m doing a test on your site and I don’t see any errors.

    Thread Starter fredointhecut

    (@fredointhecut)

    Hey,

    So, when i open for example – https://epood2.surgitech.ee/shop/swoof/product_cat-glukomeetrid/
    and i check one more subcategory like the next “Glükomeetrite testribad (3)” then the “Loading…” box comes in the center of the screen, and it will not go away AND it will not load the category. If i manually refresh the page, then it dissapears and the category is loaded. BUT the interesting part is, from my clients computer, it works like a charm but in mine, id doesnt. Cleared caches, tried different browsers, tried incognito mode, tried with my phone, tried with my gaming PC, nothing works in my end, but when i made Teams call just now, i saw how it worked fine for them. Don’t know why it’s not working on my devices?

    Regards,
    Fredi

    • This reply was modified 6 months, 2 weeks ago by fredointhecut.
    Thread Starter fredointhecut

    (@fredointhecut)

    Hey,

    So when the cliend cleared cache, same problem appeared for them also, the “Loading” will not leave and categories wont refresh, URL is changeing but not the products, and after refreshing the page it will load the products.

    Regards,
    Fredi

    Plugin Support mediawebster

    (@mediawebster)

    Hello Fredi

    Looks like you disabled the plugin and I can’t check it

    It might have been related to JS optimization. try to disable this especially lazy loading js

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘URL links to categorys’ is closed to new replies.