Skip Navigation

[Resolved] Present one product category on product page.

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 0.60 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by hyukP 5 years ago.

Assisted by: Minesh.

Author
Posts
#1376647
GB-Shoes-Only-one-category.jpg
GB-Shoes-Only-category-shortcode.jpg

Tell us what you are trying to do?
Present one product category on the product page.

Is there any documentation that you are following?
No. I searched for an answer. Didn't find one.

Is there a similar example that we can see?
hidden link
The product is in two categories but I want to only present one. In the above example, I would like the title ESSENTIALS removed.

I'm using Toolset Layouts.

What is the link to your site?
hidden link

#1376847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

With the problem URL, you shared, I see it only displays the Ashton category at top of the page just beside the price. Is it hardcoded or you yourself found the solution.

If its hardcoded and you are still looking for solution, I think it is achieved by adding a taxonomy view. If you need help there please share wp-admin access details and I will be happy to check and add it for you.

I have set the next reply to private which means only you and I have access to it.

#1378627

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've created the following taxonomy view filter by taxonomy term = Taxonomy term ID is set by the shortcode attribute "term"
=> hidden link

I see you set the primary category using Yoast so you need to filter with Yoast primary category using view's shortcode attribute. Then within the layout where you displaying the taxonomy using view's shortcode, I replaced with the above view.

[wpv-view name="filter-taxonomy-on-product" term='[wpv-post-field name="_yoast_wpseo_primary_product_cat"]'] 

Can you please confirm it works as expected?

More info:
=> https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes

#1379067

My issue is resolved now. Thank you!