What's your biggest current challenge? Have your say in Community Polls along the right column.

"Added to cart" pop up after adding to cart using custom "Add to cart" button on product page

"Added to cart" pop up after adding to cart using custom "Add to cart" button on product page

Nendas
Visitor
2 0 2

We are using the Dawn theme and in the Product page, we've added the following code to add a "Add to cart" button:

 

<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product_card_product.first_available_variant.id }}" />
<input min="1" type="number" id="quantity" name="quantity" value="1"/>
<input type="hidden" name="return_to" value="back" />
<input type="submit" value="Add to cart" class="btn" />
</form>

 

When the item is added, the cart is updated and all is well. However, we would like to have the default "Item added to your cart" popup appear after the item is added to the cart via our custom form (example image of the pop up below):

 

Nendas_0-1646917864785.png

 

Can this be done? Much appreciated!

Replies 3 (3)

Zworthkey
Shopify Partner
5581 642 1583

@Nendas 
Yea, it's the by default features of Dawn theme.

Nendas
Visitor
2 0 2

Hi Zworthkey,

 

Thanks for your reply - I probably need to rephrase the question: we've actually added a custom "Add to cart" button on the product-card.liquid so that a user can add to cart without going into the product details.

 

However, when they add to cart, the default "Item added to cart" doesn't come up. How to we trigger that pop-up after someone clicks our custom "Add to cart" button on the product page? Here's an example of what it looks like on our website:

Nendas_0-1646920149636.png

As you can see, those "Add to cart" buttons were included by us. What we're looking for is that if someone does add to their cart, we would like the pop-up to appear (as it doesn't now).

 

Hope that clarifies the question!

evaliah
Visitor
1 0 0

I need help with this too please. Can someone please reply with a solution? I've had complaints about the pop up not being shown when added to cart via collections page and then people end up with 10 of the same item in the cart. 

 

Thank you