I disabled the plugin and still the page refreshes when pressing add to cart. The variable not changing is due to price rounding up function in functions.php
add_filter( 'woocommerce_get_price_excluding_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_get_price_including_tax', 'round_price_product', 10, 1 );
add_filter( 'woocommerce_tax_round', 'round_price_product', 10, 1);
add_filter( 'woocommerce_get_price', 'round_price_product', 10, 1);
function round_price_product( $price ){
// Return rounded price
if ($price % 10 > 5) {
$newPrice = floor($price / 10) * 10 + 9.95;
} elseif ($price % 10 <= 5) {
$newPrice = floor($price / 10) * 10 + 5.95;
}
return $newPrice;
}
I need this function for website. How does the plugin change the add to cart button?
<button class="single_add_to_cart_button buy_button fl_left button alt" type="submit">Add to cart</button>