Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: ShoppingCart.GetAddToCartForm()

  1. #1
    matthewkimber is offline Junior Member
    Join Date
    Jul 2007
    Location
    Ogden, Utah
    Posts
    20

    Default ShoppingCart.GetAddToCartForm()

    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

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

  3. #3
    matthewkimber is offline Junior Member
    Join Date
    Jul 2007
    Location
    Ogden, Utah
    Posts
    20

    Default

    Thanks for pointing me to that!

  4. #4
    matthewkimber is offline Junior Member
    Join Date
    Jul 2007
    Location
    Ogden, Utah
    Posts
    20

    Default

    So is there any possible way to actually add something to the shopping cart programmatically without using the querystring?