Refresh your page when the add to cart button is clicked. Add it to your functions.php / plugin
One Way
- add_action('woocommerce_add_to_cart', 'refresh_function');
- function refresh_function(){
- header("Refresh:0");
- }
Another Way
- add_action('woocommerce_add_to_cart_redirect', 'refresh_function');
- function refresh_function($url = false) {
- // If another plugin beats us to the punch, let them have their way with the URL
- if(!empty($url)) { return $url; }
- // Redirect back to the original page, without the 'add-to-cart' parameter.
- // We add the `get_bloginfo` part so it saves a redirect on https:// sites.
- return get_bloginfo('wpurl').add_query_arg(array(), remove_query_arg('add-to-cart'));
- }