I have WooCommerce products with custom taxonomy ”tax-productname”.
I also have a custom post called ”patterns” and it has a taxonomy ”tax-patterncategory” plus the mentioned taxonomy ”tax-productname”.
Now I have a list of patterns in product page, that works ok (filtered by tax-productname). My problem: I want to create a list of products which are triggered by the ”tax-patterncategory” link and they should have the same ”tax-productname” as the triggering pattern. So kind of archive view of patterns, but not show patterns but products which have the same taxonomy as the pattern.
If I understand correctly you want to filter your CPT by the the current product's "tax-productname", however the "tax-productname" shares the same taxonomy term names as the "tax-patterncategory" that is assigned to the pattern CPT?
Are you currently listing out the pattern CPT using the classic views setup ?
Thank you Shane, I'm not sure if you got it right. I must say this is hard for me to wrap around my head. I try to clear.
- (C)PT product -> attached to CT tax-productname
- CPT pattern -> attached to CT's tax-productname and tax-patterncategory
In product content template I show all patterns that are attached to this product in question (list based on tax-productname). With the product name and image I show the tax-patterncategory and when clicking this tax-patterncategory I want to show all products which have patterns which are attached to this tax-patterncategory.
It would be easy if I attached the tax-patterncategory straight to product, but there are so many products that this would be very non-efficient. I would like to "group" the attachement with this tax-productname.
Perhaps if you give me an example it would be better understood.
For e.g if you have Product A then these are the posts I want to list under it A B C D
Product A
- Post 1
- Post 2
Product B
- Post 3
- Post 4
If you provide me with admin access to the site as well as a link to a product and the posts that you want to show that would be related then perhaps we can work through a solution to resolve this.
Thanks,
Shane
The topic ‘[Closed] List of products in same taxonomy with custom post’ is closed to new replies.