[[+content_image]]
P
P
Philip Gavrilov2017-08-07 19:21:29
MODX
Philip Gavrilov, 2017-08-07 19:21:29

How do I change the "Add to Cart" button to "Checkout"?

Shop on MiniShop2.
The "Add to Cart" button is implemented as standard:

<button type="submit" class="btn btn-default" name="ms2_action" value="cart/add">
                        ms2_frontend_add_to_cart
                    </button>

I want that after adding the product, the button changes to "Checkout" with the appropriate link to the cart.
What is the best way to implement this in minishop?

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
P
Philip Gavrilov, 2017-08-10
@Filgavrilov

Decision.
Don't forget JQ.

<button type="submit" class="btn btn-default add_cart_first" name="ms2_action" value="cart/add">
ms2_frontend_add_to_cart
 </button>                        
                            
<a class="hide add_cart_second" type="submit"  href="" >
Оформить заказ
</a>

<script>
$(document).on('click', '.add_cart_first', function(e) {
$(this).hide();
$(this).next('.add_cart_second').show();
});
 </script>

S
Sanes, 2017-08-07
@Sanes

Write by hand. Or look in lexicons.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question