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

Re: The "Add to Basket" button is redirecting to the /cart page instead of opening the dra

Re: The "Add to Basket" button is redirecting to the /cart page instead of opening the drawer

adkowaty
Excursionist
36 0 1

Dear community,

 

I’ve added an "Add to Cart" button to the featured collection on my homepage by inserting the following code into 

snippets/card-product.liquid.

 

<form action="/cart/add" method="post" enctype="multipart/form-data" class="product-form">
<input type="hidden" name="id" value="{{ card_product.variants.first.id }}">
<button type="submit" class="button button--primary add-to-cart">Add to Cart</button>
</form>

 

I’ve set the cart type to "drawer" in the cart options, but when I click the "Add to Cart" button, it redirects me to the /cart page instead of opening the drawer.

 

Does anyone have any suggestions on how to fix this?

 

Thanks in advance!

Best regards,
Adrian

Replies 8 (8)

Sam416
Shopify Partner
35 2 4

Hi @adkowaty 

Can you share store URL?

Shopify Expert | E-commerce Specialist | Custom Shopify App Development | Shopify Theme Customization & Bug Fixing | Buy Me A Coffee| Hire me| Contact Me on WhatsApp
adkowaty
Excursionist
36 0 1

Hi Sam,

 

Sure. 

https://vapelounge.uk/ - password: vl

 

Regards,

Adrian

Sam416
Shopify Partner
35 2 4

Hi @adkowaty 

Hi,
1. go to the theme customization.
2. Select a Feature collection
3. search for quick add setting and choose the standard option
It will resolve your issue of redirecting to the cart page.

Sam416_1-1727353484593.png

 

Shopify Expert | E-commerce Specialist | Custom Shopify App Development | Shopify Theme Customization & Bug Fixing | Buy Me A Coffee| Hire me| Contact Me on WhatsApp
adkowaty
Excursionist
36 0 1

Hi Sam,

 

I have this option selected, but still do not work. 😕

ScreenShot Tool -20240926163200.png

 

Regards,

Adrian

Sam416
Shopify Partner
35 2 4

Which theme you are using?

Shopify Expert | E-commerce Specialist | Custom Shopify App Development | Shopify Theme Customization & Bug Fixing | Buy Me A Coffee| Hire me| Contact Me on WhatsApp
adkowaty
Excursionist
36 0 1

Hi Sam,

 

Dawn version 15.1.0

 

Regards,

Adrian

Sam416
Shopify Partner
35 2 4

I can develop the custom code needed to add items to the drawer from the collection feature page. Please connect with me to discuss further.

Shopify Expert | E-commerce Specialist | Custom Shopify App Development | Shopify Theme Customization & Bug Fixing | Buy Me A Coffee| Hire me| Contact Me on WhatsApp
adkowaty
Excursionist
36 0 1

Sam,

 

Sorry no budget, anyway thanks for your interest.

 

Regards,

Adrian