Skip Navigation

[Résolu] Override Woocommerce Views Product Template conditionally

This support ticket is created Il y a 4 années et 1 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Marqué : 

This topic contains 8 réponses, has 3 voix.

Last updated by Nicholas Il y a 4 années et 1 mois.

Assisted by: Shane.

Auteur
Publications
#1526945

Hi Toolset Team,
we are using WooCommerce Views from Toolset and we have set Single Product template to "WooCommerce Views plugin default single product template" (like hidden link) but we want to override that template from our theme and when we are creating /theme/woocommerce-views/single-product.php that's not picking this file it's still picking template from plugin template

And we want this flow for some of product and for some of product the current stuff is perfectly fine so we want it conditional if that picking from theme then we can make code conditional so can you tell us why it's not working when we are placing template in theme folder?

Thank you for your help!

#1527393

Shane
Supporter

Languages: Anglais (English )

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

Hi Nicholas,

Thank you for getting in touch.

This is actually meant for when you are creating a custom template using our Views or Blocks plugin for your Products.

Is it that you want some Products to have the template created in Views and other products have the template created in your theme ?

Please let me know.
Thanks,
Shane

#1528049

Yes. Correct.

#1529259

Hi, Shane is out today for a national holiday and will return tomorrow to continue assisting you.

#1530201

Thanks, Christian.
Maybe you can help me with this in the meantime.

#1530597

Shane
Supporter

Languages: Anglais (English )

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

Hi Nicholas,

This is actually possible when creating your products.

What you need to do is for products when you are creating them is to select the content template when you want this product to be displayed with the content template and for products that you don't want to have the content template to be set to none.

Thanks,
Shane

#1530791

That we know how to apply none template but when we create /theme/woocommerce-views/single-product.php in our active theme but that product still taking template from plugin instead of our theme template which we are trying to override because in Woocommerce views setting the plugin template has been chosen that's why.

So what we want is that need to keep that setting as it is and override the Woocommerce views plugin template with theme, I hope this makes sense

#1530893

Shane
Supporter

Languages: Anglais (English )

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

Hi Nicholas,

Unfortunately no this isn't possible to do.

The reason is because the Woocommerce Views template is required if you want to create a custom template for your products.

So any editing would need to be added to the woocommerce views template itself, since without this template you won't be able to have your custom template.

Thanks,
Shane

#1533383

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.