"Add to cart" button

Solved
Highlighted
New Member
5 0 0

Hi there,

I use the brooklyn theme and recently created an "Add to cart" button for my products in the categorie-list -> https://alpengummi.shop/en/

But now I can't get them to be centred

I added the button-code (<form> to </form>) bevore the last </div> in the product-grid-item.liquid, like this:

  {% if template contains 'collection' %}
{%endif%}
  </div>
  <form style="margin-bottom:40px" style="text-align:center"  class="product-form" action="/cart/add" data-productid="{{product.id}}"  method="post" > 
  <input type="hidden" name="id" data-productid="{{product.id}}" class="product-select" value="{{ product.variants[0].id }}" data-variant-title="{{ product.variants[0].title }}" />
   <button type="submit" class="btn btn btn-default"><i class="icon icon-cart">&nbsp;</i>Ins Wagerl</button>
    </form>
</div>

 

It was centred when I had it at a different spot, but then it was only showed inside the categories but not on the main page.

Hope somebody can help me.

Thanks!

0 Likes
Highlighted
Shopify Partner
1151 232 299

This is an accepted solution.

Hello,

Add this css at the bottom of file name 'timber.scss.liquid' You can find it under Assets.

form.product-form {
    text-align: center;
}


Thanks 

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
5 0 0

Worked great, thank you!!

0 Likes