Monday 31 October 2016

Woocommerce add to cart button redirect to checkout Learn

Method 1 for manual link:-

Try WooCommerce default method for add to cart button redirect to checkout. You can find the option in the WooCommerce -> Settings -> Products -> Display area. When the option “Redirect to the cart page after successful addition” is checked it will redirect all users to the cart after adding a product to the cart.
Uncheck it.



Then directly use following code:-
<a href="/checkout/?add-to-cart=2817&amp;quantity=1">Add to Cart</a>
2817 is procuct id.
1 is number of products add in cart.

Method 2:-

1. You can find the option in the WooCommerce -> Settings -> Products -> Display area. When the option “Redirect to the cart page after successful addition” is checked it will redirect all users to the cart after adding a product to the cart.
Uncheck it.



2. Woocommerce > Settings > Checkout (Tab) - where you should select pages for cart and checkout.
Selcect Cart Page as Checkout option from drop down menu.


Just it.
Now, Add to cart button will redirect to checkout page.


For more Interesting, Useful Article & codes visit IT New Code.




Ankit Shah PHP Expert

IT New Code suggest a solution for your problem related to coding, Specially .PHP, Wordpress, WooCommerce, Magento, HTML and CSS. Visit Our website for Information.

0 comments:

Post a Comment

 

Copyright @ 2016 IT New Code | Developing Code | Designing Code.

Designed by: Ankit Shah