WooCommerce Add to Cart URLs

Learn About Custom Add To Cart URLs for WooCommerce without using a Plugin. Easy and Simple Redirects Without Using AJAX.

This tutorial is for anyone that wants to use custom URLs for WooCommerce add to cart. I came across this because I wanted to set up a landing page with an easier flow of checkout and I found an article that showed a lot of ways how to achieve this. So I wanted to share this with our community.

For all these features to work we need to make sure we do the following in the Woocommerce -> Settings -> Products

Disable Redirect to the cart page after successful addition

1. Simple Products: Add to Cart URL

href=”https://yourdomain.com/?add-to-cart=25&quantity=1“

2. Add to Cart and Redirect to Check Out

href=”https://yourdomain.com/checkout/?add-to-cart=25&quantity=1“

3. Variable Products: Add to Cart

inside the variations tab there is a number you will use that as the ID of the product

href=”https://yourdomain.com/?add-to-cart=88&quantity=1“

4. Grouped Products: Add To Cart URL

href=”https://yourdomain.com/?add-to-cart=3111&quantity[1803]=5&quantity[1903]=2″

In this case, we’re adding Grouped Product ID = 3111, and specifically, we’re adding 5x product ID = 1803 and 2x product ID=2.

Note: if you want to add “zero” for one of the sub-products, you still need to specify that i.e. &quantity[1903]=0.

For More Documentation: https://www.businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/