Shopping cart error when adding products to cart occurs due to conflict with Elementor Pro plugin version 3.12: https://prnt.sc/7fuYnsffVRi1
To fix this problem, please add the following code in your functions.php file (child-theme):
if(class_exists('WooCommerce')) {
add_filter( 'woocommerce_add_to_cart_fragments', 'elementor_pro_cart_count_fragments' , 1, 9999 );
function elementor_pro_cart_count_fragments($fragments) {
ob_start();
woocommerce_mini_cart();
$mini_cart = ob_get_clean();
$fragments['div.widget_shopping_cart'] = '<div class="widget woocommerce widget_shopping_cart"><div class="widget_shopping_cart_content">' . $mini_cart . '</div></div>';
return $fragments;
}
}
-
This topic was modified 1 year, 5 months ago by Billy Nguyen.