Dawn theme add to cart button not optimised for mobile

Solved

Dawn theme add to cart button not optimised for mobile

Michael185
Excursionist
14 3 1

Hi everyone, I wanted an add to cart button so I'm using


<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product_card_product.first_available_variant.id }}" />
<input type="hidden" min="1" type="number" id="quantity" name="quantity" value="1"/>
<input type="submit" value="Add to cart" class="button"
style="margin-top:10px;
margin-left:25%;
margin-right:25%;
border-radius:10px;
"/>
<input type="hidden" name="return_to" value="back" />
</form>


in the product card liquid. It's looking fine, but on mobile it's not optimised and is all over the place in terms of formatting.

The preview theme is: https://asa7msqrwt0iyyp6-25650495566.shopifypreview.com

Not sure how to keep the button centred but would love having an add to cart button
thanks!

Accepted Solution (1)
Michael185
Excursionist
14 3 1

This is an accepted solution.

Currently using 

<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product_card_product.variants.first.id }}" />
<input type="hidden" type="number" id="quantity" name="quantity" value="1"/>
<input type="submit" value="Add to cart" class="button" style="margin-top: 17px" />
</form>

In the product.card.liquid 

But it directs to the add to cart page so still trying to figure out how to make it just work as a quick add/popup

 

View solution in original post

Replies 5 (5)

DelightCart
Shopify Partner
1257 83 157

@Michael185 Can you please send me screenshot exactly?

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.
Michael185
Excursionist
14 3 1

Hi! Sorry I didn't see a notification you'd responded!

Here's the screenshot of desktop and mobile version.

So it all looks fine on desktop but the mobile is really squeezed
Screenshot 2022-03-21 201606.pngScreenshot 2022-03-21 201535.png

amrslama72
Shopify Partner
1 0 0

Hello Michael, Im having the same problem did you reach a solution?

 

Michael185
Excursionist
14 3 1

No still haven't heard anything

Michael185
Excursionist
14 3 1

This is an accepted solution.

Currently using 

<form method="post" action="/cart/add">
<input type="hidden" name="id" value="{{ product_card_product.variants.first.id }}" />
<input type="hidden" type="number" id="quantity" name="quantity" value="1"/>
<input type="submit" value="Add to cart" class="button" style="margin-top: 17px" />
</form>

In the product.card.liquid 

But it directs to the add to cart page so still trying to figure out how to make it just work as a quick add/popup