• Resolved Anthony-French

    (@anthony-french)


    Hello,
    I looked for a long time without finding the answer to my problem.
    Is there a way to pre-filter category searches when you are on the shop’s homepage? This can be useful when implementing WooCommerce Products Filter in a mega-menu for example.
    Currently, if I implement the plugin in the Category A menu and in the Category B menu it will offer me searches on the entire store instead of offering them in its respective category.
    Thanking you.
    Anthony

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello Anthony

    On category page – The filter will automatically recalculate the values for the current category – https://c2n.me/3Wg4ZIU.png

    For custom page:

    1) In category pages use shortcode – [woof_products] with attribute : taxonomies=product_cat:X Where X id your product category.

    2) In widgets use shortcode [woof] with attribute : * taxonomies=product_cat:X
    +
    tax_only – write taxonomies or products slug using comma
    +
    by_only – write any by-filter-elements there using comma: by_text,by_price,by_sku,by_author,by_insales,by_instock. Of course firstly user should enable extensions for that by-filter-elements
    *- Do not forget set the same condition in [woof_products]

    3) For show or hide widgets on different pages – https://www.woocommerce-filter.com/how-to-show-or-hide-widget-only-on-selected-site-pages/

    You can read more about shortcodes – https://www.woocommerce-filter.com/documentation/#!/section_3_1

    Thread Starter Anthony-French

    (@anthony-french)

    Hi Pavlo
    Thank you very much for your precise answer!
    It helped me a lot in my need.
    I see we can do a lot of things with the woof shortcode …
    However, is there a way without the shortcode (filter automatically) so that attributes not present in a category (value = 0) are not displayed at all on the category page?
    For example on this page : https://e-sens.site/preprod-fete/category-product/accessoire/? Swoof = 1 & paged = 1 & product_cat = latex clip-balloon & really_curr_tax = 2085-product_cat
    The category does not include products with “themes disponibles” or “licenses disponibles” (all values in the list = 0) and yet these 2 lists appear: /
    Hoping not to abuse your time.
    Anthony

    Thread Starter Anthony-French

    (@anthony-french)

    Hello again,
    Compared to my last question (unanswered) I understand that the paid version of the plugin does not display the values = 0. I am ready to buy the plugin but I will be sure he does it well. Can you confirm it please?
    Regards,
    Anthony

    Hello Anthony

    sorry for the delay, I had a vacation

    Yes, the plugin can hide terms that have a counter equal to zero

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Restrict to category on home page’ is closed to new replies.