1. cliveportman
  2. /code
  3. /shopify-add-to-cart-form-for-sending-visitors-direct-to-the-cart-from-another-website

Shopify Add To Cart form for sending visitors direct to the cart from another website

Send people straight to a Shopify cart from another website with a quick Add To cart form like the one below. You'll need to get the variant ID.

<form action="http://shop.myshopify.com/cart/add" method="post" class="addtocartform">                            
    <input  type="hidden" id="" name="id" value="enterVariantIdHere">
    <button type="submit" name="add" class="blocklink buybutton">Book now</button>

Using this method rather than the permalink method means visitors can adjust quantities in their cart.

We used this on the recent 40th birthday site for Leiths Cookery School.