ajaxify-cart icon indicating copy to clipboard operation
ajaxify-cart copied to clipboard

Change cart from Input to <button>

Open sparkyhd opened this issue 7 years ago • 2 comments

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 avatar Mar 13 '17 09:03 sparkyhd

@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.

onotype avatar Mar 13 '17 11:03 onotype

@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>

sparkyhd avatar Mar 13 '17 11:03 sparkyhd