add buttons add to cart in collection page

New Member
1 0 0

Hello,

I am on the theme Parallax and I would like to add add to cart buttons under each product on the collection page.
In searching I found this code:

<form method = "post" action = "/ cart / ajouter">
     <input type = "hidden" nom = "id" valeur = "{{product.variants.first.id}}" />
     <input type = "submit" value = "Ajouter au panier" class = "btn" />
      </ form> 

It works but there are 2 problems:

- it is not suitable for mobile
- the button is not centered under the product image but on the left

 

 

0 Likes
New Member
3 0 0

Hi @guillaumeritter I'm trying to get this done as well!  Were you able to resolve the mobile functionality?

0 Likes
Shopify Expert
96 17 12

@guillaumeritter - Send across your store URL and I can take a peek.

0 Likes
New Member
3 0 0
0 Likes
Shopify Expert
96 17 12

@lightmove - You had mentioned you added code and needed the button styled.  I am not seeing the code on the page you provided.  Can you clarify and/or ensure that the code that was functioning is present and I can help with making it look as expected?

0 Likes
New Member
3 0 0
Sorry - I wasn’t clear. I was looking at a few variations of code in this feed from other users. I haven’t don’t anything because I’m afraid to break my website before a big launch tomorrow. Will probably wait a week or two to fix the friction in checkout. Thanks again for your help!
0 Likes