Forum

Thread tagged as: Question, Shop

Styling the add to cart button

Hello,

Very basic question, I was wondering how to use an image, div, or button element to add to cart rather than the wee grey default one.

This is the default code in the list.html template, how do I adapt this to be anything other than the default cart button.

Apologies in advance.

<perch:form id="add_to_cart" app="perch_shop" action="/shop/cart">
    <perch:input id="product" type="hidden" value="<perch:shop id="productID" env-autofill="false" />" />
    <perch:input type="submit" value="Add to cart" />
</perch:form>
Chris McMahon

Chris McMahon 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

The button is

<perch:input type="submit" value="Add to cart" />

you can replace that with any sort of button you like. If you do, be sure to add

<perch:input type="cms" />

as well.

Terrific, thanks Drew.