Answer the question
In order to leave comments, you need to log in
How to do if there is one product in the category, then immediately go to the woocommerce product?
Hai.
The question is.
If there is only one product in the category, then when you click on the category, you should immediately go to the product, bypassing the category.
There is a solution?
---
Found so far some such solution. I'll check it out https: //wordpress.org/support/topic/shop-page-if-o ...
Answer the question
In order to leave comments, you need to log in
Theses:
1. Hook template_redirect.
2. Next, the conditional tag https://docs.woocommerce.com/document/conditional-tags/ to check the required taxonomy
3. Next, get the term ID
4. Next, get the first 2 products inside this term
5. If there are 1 products, then do wp_redirect ()
Something like that.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question