I am working on a shop where I sell variable products.
Each product has 1 global attribute with 3-5 terms used as variants also. I used this code to show the default variant price on shop page and this one to change the price according to the selected variant on product page.
Attribute: Condition | Terms: Ver1, Ver2, Ver3, Ver4, Ver5.
I have an archive page which can be accesed on localhost/condition/ver1 and show only the products with ver1 variant.
I would like:
- When I go to the above page to display the price of that variant (Ver1) for all products.
- When I click on a product from this page, take me to the product page with Ver1 like default variant selected.
I think this problems can be solved with term_link() but I'm not sure how to do it. Thank you!