ajaxify-cart
ajaxify-cart copied to clipboard
Change cart from Input to <button>
I'd like to put the product title inside the Add to Cart description and break it across 2 lines. To style it I'd like to use
<input type="submit" name="button" class="add" value="Add {{ product.title }} to Cart - {{ variant.price | money }}" />
replaced with
<button type="submit" name="button" class="add">Add to Cart<br>{{ product.title }} - {{ variant.price | money }}</button>
Could the script be more generic so it picks an element by id rather than looking for the submit button?
@sparkyhd Doesn't it already do that? The addToCartBtnSelector: '[type="submit"]',
part should make it so it picks up any element with type
set to submit
. So I'm sure even if it's a button as longs as it has type=submit
, it should work.
@onomori it does the first part, add to cart, perfectly. It's the response part that doesn't work
<i class="fa fa-check"></i> Added to cart! <a href="/cart">View cart</a> or <a href="/collections/all">continue shopping</a>