Archived topic
Woocommerce button now not working
10 replies · Started by Edward on March 26, 2021
Since updating new GP theme the woocommerce function is not working on my site. I should have a "add to cart" button on each product page which is now just showing up txt - [addtocartonpage]. the cart page is also just showing text - [ec_cart]
I know it to be the update as I looked at my staging site and as soon as I updated GP on this staging site it happened immediately.
product page example - https://lubelska.co.uk/lubelska-brick-tiles/light-lubp/
cart page - https://lubelska.co.uk/cart/
Help!
Hi there,
Not sure if I understand but GP isn't capable of causing issues like this.
The page you've linked is just a static page and that isn't a default function from WooCommerce.
It just looks like the shortcodes aren't being executed.
Perhaps you've added some custom functions in the parent theme which got erased during updates?
You can also try activating a Twenty series WP theme and I believe you will see the exact same issue as well.
Let me know :)
Ok. Yeh it’s a custom function. Why when I updated GP it was erased though?
Ed
Hi there,
if you added the custom function to the GP theme files eg. functions.php, then yes this code will get removed when the theme is updated. Its standard practice to never edit the parent theme files as WP replaces the entire theme when updates are made. Instead you would either:
1. Use a child theme to add your custom functions.
2. Use the Code Snippets plugin to add the function.
Hi David,
Ok thanks for clearing that up. So just to clear up for the future, as we add this custom function again, you would advise adding it via the code snippet plugin? This would mean when we update GP for the future it won't be removed?
thanks for your help.
Ed
Thats correct - code added via the Code Snippets plugin ( or child theme ) will remain after theme updates.
Is there any documentation on the code snippet plugin. Is it something I can download from the plugin section?
or is there a specific code snippet plugin you recommend?
This is the plugin we recommend:
Ok thanks.
You're welcome