Skip Navigation

[Resuelto] Override single-product.php

This support ticket is created hace 8 años, 1 mes. 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
- 8:00 – 12:00 8:00 – 10:00 8:00 – 14:00 8:00 – 14:00 8:00 – 12:00 -
- 13:00 – 18:00 11:00 – 18:00 15:00 – 18:00 15:00 – 18:00 13:00 – 18:00 -

Supporter timezone: Pacific/Pago_Pago (GMT-11:00)

Etiquetado: 

This topic contains 4 respuestas, has 2 mensajes.

Last updated by christerA hace 8 años, 1 mes.

Assisted by: Mladen Andrejic.

Autor
Mensajes
#372669

I'm trying to override single-product.php.
I have put a copy in:
yourtheme/woocommerce/single-product.php (i'm using Dynamic website builder based on Genesis)
But it still uses the version in woocommerce-views/templates
If i rename that one, it works. Then it uses the one in yourtheme/woocommerce/
But that's no good, because the next update of WooCommerce Views will create a new version, right?

#372868

Hello,

Thanks for contacting Toolset support.

Generally, yes - when you update it it will use the file you renamed. But I can't think of any other solution then to rename the file when there is an update, as this is designed to use the one from woocommerce-views

Thanks.

#373120

I don't really understand the point of of putting it in yourtheme/woocommerce/ if i have to do a fix anyway every time there is an update?
Then i can just as well do the fix in woocommerce-views/templates?
Why even having this line in the header in single-product.php:
"* Override this template by copying it to yourtheme/woocommerce/single-product.php"

Are there really no way of avoiding the fix with every update? I mean, most of my clients will never be able to do that themselves in the future.

#373350

Hello,

There is a reason for sure why developers had this approach, although I am not certainly aware of it.

Maybe to make it easier for the customers, you can create .php file called for example "fix-it.php", and then give them get_template_part code and tell them where to place it inside the updated file?

Thanks.

#373370

OK, thanks.

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