I am new to WordPress and I am using WooCommerce for a online store. I have found a small issue on one of the plugins that i needed for a specific product, and now I shall need to refresh the page automatically after adding the product on cart.
How can I easily do it without promise the whole store? Is there anyway I can achieve this?
I did try to search for the origin php or js for add to cart event, but I couldn't find anything, and afterwards I tried to add a location.reload()
to the add to cart class but it didn't solve my problem as well. This is everything i've tried so far.
I am new to WordPress and I am using WooCommerce for a online store. I have found a small issue on one of the plugins that i needed for a specific product, and now I shall need to refresh the page automatically after adding the product on cart.
How can I easily do it without promise the whole store? Is there anyway I can achieve this?
I did try to search for the origin php or js for add to cart event, but I couldn't find anything, and afterwards I tried to add a location.reload()
to the add to cart class but it didn't solve my problem as well. This is everything i've tried so far.
- Hello and wele. Please read the Stack Overflow question checklist. You might also want to learn about Minimal, Complete, and Verifiable Examples. – ArielGro Commented May 25, 2020 at 19:07
1 Answer
Reset to default 2Maybe this will work for you. It will refresh your page when the add to cart button is clicked. Add it to your functions.php
add_action('woomerce_add_to_cart', 'refresh_function');
function refresh_function(){
header("Refresh:0");
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745568178a4633521.html
评论列表(0条)