how to skip cart page and redirect to checkout after clicking Buy Now button

sohailafridy
Shopify Partner
2 0 0

Hi, all

I have a problem I am using down theme and I want to redirect to checkout after clicking buy now button but instead of checkout page it redirect to home page why?

Please any liquid expert

my form is 

<form method="post" action="/checkout">

         <input type="hidden" name="id" value="{{ card_product.variants.first.id }}">

         <input type="number" id="quantity" name="quantity" min="1" value="1">

         <input type="submit" value="Add to cart" class="button">

</form>

Action is checkout but it may redirect to home page 

Replies 3 (3)

Simonsron
Shopify Partner
699 87 121
{% form 'product',product %}

         <input type="hidden" name="id" value="{{ product.variants.first.id }}">

         <input type="number" id="quantity" name="quantity" min="1" value="1">

         <input type="submit" value="Add to cart" class="button">

{% endform %}
banned
sohailafridy
Shopify Partner
2 0 0

Sir not add to cart I want to skip cart button instead of add to cart I want it Buy now and after clicking Buy Now button, want to redirect it direct to checkout out page

Kumar2573
Shopify Partner
168 8 21

<form method="post" action="/cart/add" style="visibility:hidden">
<input type="hidden" name="id" value="{{ vardID }}" />
<input type="hidden" name="return_to" value="/checkout"/>
<input min="1" type="number" id="quantity" name="quantity" value="1" style="display:none;">
<input id="checkout_page" type="submit" value="Buy Now" class="btn" />
</form>

Expert Shopify Plus & shopify Developer & Theme customizer
- If the problem is solved remember to click to Accept Solution
- Press Like ?? if the answer was helpful
- Still, Facing issue, Reach out to me Email :- jitendra3496@gmail.com | Skype :- jitendra2573_1
- Direct Hire me :- Direct Contact me