Can I create a URL to add autoship products to the cart?


Autoship Cloud uses data attributes to attach a frequency type and frequency to simple and variable products, so to construct an "add-to-cart" url that includes these data attributes is pretty straightforward.

Example: Simple Product URL

Modify the url to include our autoship attributes, so for example say you want to add a product id "11057" to the cart with a quantity of "1", a  frequency type of "Monthly" and frequency of every "5" months:

Example: Variable Product URL

This is a little more complicated with product variations.  For more detailed instructions and examples on constructing add-to-cart URLs, you should check out this very helpful article WooCommerce Custom “Add to Cart” URLs – The Ultimate Guide

In this example, we’re modifying the URL to add a Variable Product ID "10995", and specifically its variation ID "10997" where the color attribute is equal to "tan".

Want to redirect to the cart? Once again this helpful guide provides more examples for modifying the URL to perform the action your want.  Here's the same product variation as above but redirected to the cart in the URL:

Still need help? Contact Us Contact Us