I am in the process of creating my own GetAddToCartForm method that will return the necessary JavaScript and HTML for a custom XmlPackage. The question I had was what hidden inputs does addtocart.aspx expect to correctly add a product to a cart?
One caveat to this simple question is that I am mostly interested in adding a product that has multiple variants which each have various available colors and sizes. What are the hidden inputs for say the chosen size and color?
Here is a list I have gathered so far from the source code:
HTML Code:
<input name="VariantStyle" id="VariantStyle" type="hidden" value="" />
<input name="IsWishList" id="IsWishList" type="hidden" value="0" />
<input name="IsGiftRegistry" id="IsGiftRegistry" type="hidden" value="0" />
<input name="UpsellProducts" id="UpsellProducts" value="" />
<input name="CartRecID" id="CartRecID" value="CartRecID.ToString()" />
<input name="ProductID" id="ProductID" value="ProductID.ToString()" />
I suspect that there should be VariantID and then maybe a "Color" and "Size" field, but I didn't see them. Of course, my eyes kind of got tired after looking through the 10,000+ line source file (ShoppingCart.cs). Any help is greatly appreciated! Thanks!
Best Regards,
Matthew Kimber