Hi - this site currently only has 4 products, but this number will grow. There are only 2 categories - Doors and Hardware. I would like for the products categorized as Hardware to display on the single product page for doors (because this is the other thing they need to buy to go with the door). Is there any way to adjust what category displays in the Related Products section?
OK - I'm not very good at filters/php stuff. Can you tell me how I would adjust this to work in my situation? Do I add this line and change 'product_cat' to be the category I want to display? Is everything else in this line of code relevant?
Hi - this site currently only has 4 products, but this number will grow. There are only 2 categories - Doors and Hardware. I would like for the products categorized as Hardware to display on the single product page for doors (because this is the other thing they need to buy to go with the door). Is there any way to adjust what category displays in the Related Products section?
Hello Ellison,
Thanks for keeping in touch.
Please check out this article https://stackoverflow.com/questions/70884650/display-woocommerce-related-products-by-current-category-and-tags.
Hope this helps.
Thanks.
OK - I'm not very good at filters/php stuff. Can you tell me how I would adjust this to work in my situation? Do I add this line and change 'product_cat' to be the category I want to display? Is everything else in this line of code relevant?
Hi Ellison,
Please allow me to escalate this to the developer to respond further.
Thanks.
Hey Ellison,
The following snippet can be added to your child functions.php file to allow any product to be shown in the related category section:
Kind regards,