Skip Navigation

[Resolved] Multiple templates for product

This support ticket is created 3 years, 2 months 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.

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

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 18 replies, has 2 voices.

Last updated by lalK 3 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#2157187

Tell us what you are trying to do? I would like more than one template to use on products.

Is there any documentation that you are following? https://toolset.com/forums/topic/content-template-for-single-page-of-different-taxonomy-3/#post-1357307

What is the link to your site? ld.ochsonline.org

I've looked at various documentation but haven't found a solution. I think whaty I want is quite simple. If product has category x then it should use template y.

#2157529

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-09-01 at 2.09.26 PM.png

Hi Lal,

Thank you for getting in touch.

This is possible if you go to your content template and edit it. Under Usage where you select the post type the content template should apply to you will see the button "Set Condition" see screenshot.

This should allow you to setup conditionals for your template so that you can set the template based on the taxonomy term that the product has selected.

Please let me know if this helps.
Thanks,
Shane

#2157543

Thanks. I did that and it shows as a conditional template but the product page still uses the "Template for Products"

#2157653

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Was there another template created for the products that aren't meeting the conditions? If not then you will need to create one. This is because the Woocommerce blocks plugin is assuming that you will be making your own custom template.

If this is not the case please let me know.
Thanks,
Shane

#2158133

There is the tmeplate for products that I created with Toolset. The one that over-rides the Woocommerce template. There are no conditions applied to this.

Then there is the conditional template I created. The condition being that the Taxonomy term must be x

However a product with taxonomy term x still uses the template for products.

#2158503

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Would you mind allowing me to have admin access to the site so that I can have a look to see if I can understand the issue a little better?

I've enabled the private fields for your next response.

Thanks,
Shane

#2158639

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I checked on your plugins and saw that they were outdated.

Can you go to the link below and update them and let me know if the issue still remains.
hidden link

Thanks,
Shane

#2158641

Yes, plugins updated, cache cleared, but problem persists.

Best wishes,
Lal

#2158643

Yes, updated and cache cleared but problem persists.

Best wishes,
Lal

#2158845

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lal,

I will need to do some further testing on the site to see if I can find the exact cause of this issue.

Would it be ok if I took a copy of your website for further testing?

Please let me know.
Thanks,
Shane

#2158849

Sure, go for it.

#2160085

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lal,

I found the issue.

The problem is that your products don't have a default template to use when they dont meet the condition.
I see that you've used this template but it won't work unless its assigned to the products post type.
hidden link

What you need to do is create a second template for the products post type and then all your products that don't meet the conditional will default to this new template.

Thanks,
Shane

#2160113

Yes, they do.

It's this one: hidden link

It can be seen in use, for instance, at hidden link

#2160117

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-09-03 at 2.21.43 PM.png
Screenshot 2021-09-03 at 2.22.05 PM.png

Hello,

This one works perfect because its assigned to the products post type. If you check my screenshot for the 2 content templates that you're using

Your product below.
hidden link

This is using the team members content template which is not taking any effect because its not selected to work for Products. What i'm saying is that you need to create a next Content template and assign it to the products post type without any conditions.

This will serve as the default template for your products that don't meet the conditions of your already existing product template.

I hope this was a bit clearer for you.

Thanks,
Shane

#2160139

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Currently having another look. I checked and saw that this template had no conditions added.