Adding Add to Cart button under recommendation products

Highlighted
New Member
16 0 0

What we are trying to do is add a "Add to Cart" button to our recommendations section under each product BUT when they hit Add to Cart we want to use the drawer cart instead of redirecting them to the cart. We use the Prestige theme.

 

                <form class="RecommendationsForm__AddToCart Button" action="/cart/add" data-productid="{{product.id}}"  method="post"> 
                        <input type="hidden" name="id" data-productid="{{product.id}}" class="RecommendationsForm__AddToCart" value="{{ product.variants[0].id }}" data-variant-title="{{ product.variants[0].title }}" />
                        <input type="submit" value="Add To Cart" class="RecommendationsForm__AddToCart Button" /></form>

This is the code we currently use but that redirects them to the cart page.

0 Likes
Shopify Partner
460 90 109

@Dan_Haynes 

 

Send me your store url so, I can take a look and assist you better.

 

Thank you,

Tejas

Shopify Expert | skype: tejas.nadpara
- Feel free to contact me on support@hexaecommerce.com regarding any help
- Like and Mark as an Accepted Solution if reply helpful
0 Likes