Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change cart from Input to <button> #14

Open
sparkyhd opened this issue Mar 13, 2017 · 2 comments
Open

Change cart from Input to <button> #14

sparkyhd opened this issue Mar 13, 2017 · 2 comments

Comments

@sparkyhd
Copy link

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 instead of

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

@onotype
Copy link

onotype commented Mar 13, 2017

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

@sparkyhd
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants