Add to Cart

Autoship extends on the WooCommerce add-to-cart process by adding a single parameter: wc_autoship_frequency.

WooCommerce adds items to the shopping cart in two ways:

1. POST the add-to-cart form to the product page

POST /the-product-page-url
add-to-cart: [the WooCommerce product ID]
quantity: [the quantity of items to add to the cart]

WC Autoship adds one additional parameter, wc_autoship_frequency. The input element for this value is found in the Autoship Options section of the product page.

The same request with the additional wc_autoship_frequency parameter is shown below:

POST /the-product-page-url
add-to-cart: [the WooCommerce product ID]
quantity: [the quantity of items to add to the cart]
wc_autoship_frequency: [the Autoship frequency]

2. POST the add-to-cart form to the AJAX endpoint

POST /?wc-ajax=add_to_cart
product_id: [the WooCommerce product ID]
quantity: [the quantity of items to add to the cart]

WC Autoship adds one additional parameter, wc_autoship_frequency. The input element for this value is found in the Autoship Options section of the product page.

The same request with the additional wc_autoship_frequency parameter is shown below:

POST /?wc-ajax=add_to_cart
product_id: [the WooCommerce product ID]
quantity: [the quantity of items to add to the cart]
wc_autoship_frequency: [the Autoship frequency]

Still need help? Contact Us Contact Us