Add To Cart on Product Page (Collections) not opening Drawer

Highlighted
Tourist
9 0 14

Hi! I have successfully added an "Add to Cart" button below each product in the grid view. I want a user to easily be able to add multiple products to their cart.

 

Website: www.artisan-meats.myshopify.com

Theme: Brooklyn

 

The issue is that when you click "Add to Cart", the Cart PAGE is opening, not the Cart Drawer (like I have chosen in the GUI settings). 

 

Here is the code that I inserted into product-grid-item.liquid in line 81:

 

    {% comment %}
    Next bit of code has been added to include "Add to Cart" button below every product in a grid, with the quantity displayed
    {% endcomment %}
    
	<form method="post" action="/cart/add">
		<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
      	        <br />
 		<center><input min="1" type="number" id="quantity" name="quantity" value="1"/></center>
      	        <input type="submit" value="Add to cart" class="btn"/>
	</form>

Any help would be appreciated! I have tried multiple things but none of them can get the Cart DRAWER to open when "Add to Cart" is clicked for an individual product.

 

The closest I've got is to add a class these two classes "add-to-cart" and "js-drawer-open-button-right" in the code above. However, when that happens, the cart is opened, but no item is added to the cart drawer.

<input type="submit" value="Add to cart" class="btn add-to-cart js-drawer-open-button-right"/>

^ opens the cart drawer, but does not add the item to the cart

0 Likes
Highlighted
Excursionist
58 2 1

Any luck with this?

0 Likes
Highlighted
Shopify Expert
3915 559 940

if you want to open cart drawer then you have to code add to cart button with theme existing add to cart code. 

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Excursionist
58 2 1

I am using the brooklyn theme would you know what code it would be?

0 Likes
Highlighted
Shopify Expert
3915 559 940

No for that check in code as its Js task so cant send you and step. 

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
New Member
2 0 0

Hi,

I just checked your website and now items are being added to the cart directly from the product collection page.

Can you kindly share what code did you add?

Thanks

0 Likes
Highlighted
New Member
8 0 0

Hi! I have the same problem, could you solve it? Would you help me please?

0 Likes
Highlighted
Shopify Expert
3915 559 940

Try to follow this post.

Want to modify or custom changes on store hire me.
Want to give Gift for time? its my Paypal too.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com Or WhatsApp
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes