Woocommerce widget
-
https://www.rpsmusika.com/
This is my website. please go to the page(https://www.rpsmusika.com/product-category/mens-fashion/). you show left sidebar. you are scroll to the bottom and see left sidebar widget title “Products” here show randomly 5 products. I want, the same category with the product shown on same category products(Don’t show random products), related products should be fashion and If I go to food category(https://www.rpsmusika.com/product-category/foods/) here widget show food-related products. Please help me.
Thank you.
-
Hi @infoudoy,
The products widget included with WooCommerce doesn’t have an option to only show products from the same category as is currently opened. This is because this widget doesn’t normally only show on category pages, but also all other pages on your site, whether they show some products or not.
Anyway, I found a thread on Stack Overflow that explains how to make the products widget only display products from some specific categories using the
woocommerce_products_widget_query_argsfilter:https://stackoverflow.com/questions/46184153/woocommerce-products-widget-for-a-specific-category
Please note however that category names need to be given in advance, so the widget won’t adjust dynamically to the category that is currently opened. I couldn’t also find any extension plugins that can achieve such result. For this you may need to create a new shortcode or widget. This thread can be a good starting point.
Cheers!
The topic ‘Woocommerce widget’ is closed to new replies.