Answer the question
In order to leave comments, you need to log in
How to add product with ajax in woocommerce?
On the store page, when adding an item to the cart, a message appears below - "View cart". I don't know how to remove it. The message - "Would you like to add this product again", appears only after reloading the page. So, only after reloading the page, the counter of the number of goods in the basket is updated.
Product adding code:
<?php
echo sprintf(
'<a href="%s" data-product_id="%s" class="%s addToCart">%s</a>',
$product->add_to_cart_url(),
$product->get_id(),
'btn btn-black product_type_' . $product->get_type() . ' ' . ( $product->supports( 'ajax_add_to_cart' ) ? 'add_to_cart_button ajax_add_to_cart' : '' ),
$product->add_to_cart_text()
);
// loading
// added
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question