[SOLVED] How can I skip the cart and go straight to checkout?

Solved
Highlighted
Shopify Partner
9 0 0

Hi,

Here:- https://help.shopify.com/en/themes/customization/products/add-to-cart/stay-on-product-page-when-item...

you can find the steps how to do it.

Regards,

Aadrash Mehta

aadrashmehta
0 Likes
Highlighted
New Member
2 0 0

I thank you for the info. I had been looking to fix this problem since I started my Shopify store. Great to know that there is a solution for everything. Thank you again.

0 Likes
Highlighted
New Member
2 0 0

It works sometimes then not at all. Why?

0 Likes
Highlighted
Shopify Partner
2 0 1

Thank you! Worked.

0 Likes
Highlighted
Shopify Partner
2 0 1

input.JPGyou have to put the code below the other input ;) and it work even if you have variants

1 Like
Highlighted
Explorer
49 3 4

<form method="post" action="/cart/add">
<input type="hidden" name="return_to" value="/checkout/" />
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input type="submit" value="Buy" class="btn btn--primary buybuttonRuta btnmyodrers" />
</form>

0 Likes
Highlighted
Explorer
49 3 4

Please add this code that work properly good.

 

<form method="post" action="/cart/add">
<input type="hidden" name="return_to" value="/checkout/" />
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input type="submit" value="Buy" class="btn btn--primary buybuttonRuta btnmyodrers" />
</form>

0 Likes
Highlighted
Explorer
49 3 4

Go to the snippet and Add this code in product-card-grid.liqiuid. add this below the product title.

 

<form method="post" action="/cart/add">
<input type="hidden" name="return_to" value="/checkout/" />
<input type="hidden" name="id" value="{{ product.variants.first.id }}" />
<input type="submit" value="Buy" class="btn btn--primary buybuttonRuta btnmyodrers" />
</form>

0 Likes
Highlighted
New Member
1 0 0

Hi Kumar2573

 

I am using a theme Watchtica.

 

How do I skip the cart page ? I want that when the user presses on "Add To Cart" they are directly taken to the Checkout.

Here's my liquid for add-to-cart-form.liquid :

 

{% assign variantCount = product.variants | size %}
<form action="/cart/add" method="post" class="variants" id="{{id}}-{{ product.id }}" data-id="product-actions-{{ product.id }}" enctype="multipart/form-data">
{% if sold_out %}
<button class="btn add-to-cart-btn" type="submit" disabled="disabled" {% if settings.enable_multilang %}data-translate="products.product.unavailable"{% endif %}>
{{ 'products.product.unavailable' | t }}
</button>
{% else %}
{% if variantCount > 1 %}
<a class="btn btn-two" href="{{ product.url }}" title="{{ product.title }}" {% if settings.enable_multilang %}data-translate="products.product.select_options"{% endif %}>
{{ 'products.product.select_options' | t }}
</a>
{% else %}
<input type="hidden" name="id" value="{{ product.variants[0].id }}" />
<input type="hidden" name="quantity" value="1" />
<button data-btn-addToCart class="btn add-to-cart-btn btn-two" type="submit" data-form-id="#{{id}}-{{ product.id }}" {% if settings.enable_multilang %}data-translate="products.product.add_to_cart"{% endif %}>
{{ 'products.product.add_to_cart' | t }}
</button>
{% endif %}
{% endif %}
</form>

 

Screenshot 2020-02-08 at 22.04.33.png

 

Thank you in advance <3 

0 Likes
Highlighted
Tourist
3 1 0

in booster theme, I want to skip the cart direct to checkout page 

how I can do that 

0 Likes