Answer the question
In order to leave comments, you need to log in
How to replace add to cart button in WP?
There is a button for the product - Add to cart - that 's when you press it, it adds the product to the cart). And you need this button to change if the product is added to the cart. The client added the product the button has changed for example - the button says - the product has been added.
Here is the code
<a rel="nofollow" href="/?add-to-cart=<?php echo $post->ID; ?>" data-quantity="1" data-productid="<?php echo $post->ID; ?>" data-productsku="" class="button producttypesimple <?php echo (getpostmeta($post->ID, 'managestock', true) == 'yes' && (getpostmeta($post->ID, 'stock', true) - $productquantity) > 0) ? 'add addtocartbutton' : 'addtocartfalse'; ?> ajaxaddtocart added"><?php echo (getpostmeta($post->ID, 'managestock', true) == 'yes' && (getpostmeta($post->ID, 'stock', true) - $product_quantity) > 0) ? '' : 'Нет в наличии.'; ?></a>
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