Tuesday, September 20, 2022
The Great Tit
Updated: 20. 9. 2022, Added: 20. 9. 2022

Global $product cause Oxygen does not refresh CSS

The issue is related to the custom PHP functions being used the Repeaters in WooCommerce templates. Within the custom functions, after you call global $product, you need to wrap the rest of the function in an if($product) { ...do stuff here } statement. This will prevent the AJAX errors.

global $product;
if($product) { ...do stuff here }

Also do not use Global $product on single product template. Instead use:

$product = wc_get_product( get_the_ID() ); 
Did I help you? Support me on Patreon!
Beep this article to your friends!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram