Custom 'add to cart' button redirecting to cart page. I want to change this.

Custom 'add to cart' button redirecting to cart page. I want to change this.

JOR_M
Tourist
13 0 2

Recently I added a custom 'add to cart' button to the product grid on the home page of my webshop. When the visitor clicks on this, he is redirected to the shopping cart page. However, I want the customer to stay on this page or for the shopping cart to open on the right side of the page (this happens when my customer clicks the 'add to cart' button on the product page).
If this is not possible, I would like to see a small text (temporary) that says: Your product has been added to your shopping cart.

Does anyone know how I can add this, or if this is even possible?

 

Code of the custom button is as follows:

<form method="post" action="/cart/add" >
<input style="text-align: center; " type="hidden" name="id" value="{{ product.variants.first.id }}" />
<button class="btn">Voeg toe <span class="icon icon-cart" aria-hidden="true"></span></button>
</form>

 

P.S.: I already looked up a tutorial, but this tutorial was made for product pages and didn't work for custom buttons.

 

Links to the website are shown above, but here it is 🙂

https://shop.walhallacraftbeer.nl/

Replies 2 (2)

KetanKumar
Shopify Partner
37132 3647 12059

@JOR_M 

can you please check your theme customization cart setting maybe allow this 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
JOR_M
Tourist
13 0 2

Hey Ketan,

 

This is indeed a setting in Shopify, hence why it works with my product pages.

However, I want it to work for my custom button as well. This is a button I added to the HTML code. Do you know if this is possible?