Developer forum

Forum » Development » Adding multiple items to a Cart

Adding multiple items to a Cart

Lucas Neessen
Reply


Hi there,

We have a website were we make a proposal for adding products. We are using the addMulti method for adding multiple items as described in post

http://developer.dynamicweb-cms.com/forum/templates/adding-many-of-the-same-product-to-cart.aspx?PID=48

This used to work fine 6 months ago. After several necessary updates of the Dynamicweb application it stopped working.

We tried also a exact copy of the code posted on the forum in a different solution, but found it no longer
seems to work.

We also tried to do this without the form by posting to default.aspx:

/Default.aspx?CartCmd=addMulti&ProductLoopCounter1=1&ProductID1=T16@@SHOP3&VariantID1=&UnitID1=&Quantity1=2

or

/Default.aspx?CartCmd=addMulti&ProductLoopCounter1=1&ProductID1=T16%40%40SHOP3&VariantID1=&UnitID1=&Quantity1=2


Can someone show me how this should work?

Website with this problem running on 19.2.6.0.
http://www.natuursteen-tegels.net/

Lucas


Replies

 
Morten Snedker
Reply
 Hi Lucas,

Please take a look at this thread: http://developer.dynamicweb-cms.com/forum/development/adding-multiple-products-in-the-cart.aspx and let me know if it answers your question.

Regards
Morten Snedker
 
Lucas Neessen
Reply

Not really. I get the posting story. We use a plain form exactly like below

<form name="multiForm" id="multiForm" method="post" action="/Default.aspx" >

<input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" />

  

<input type="hidden" name="ProductLoopCounter1" id="ProductLoopCounter1" value="1" />

 

<input type="hidden" name="ProductID1" id="ProductID1" value="V3-33@@SHOP3" />

 

<input type="hidden" name="VariantID1" id="VariantID1" value="" />

 

<input type="hidden" name="UnitID1" id="UnitID1" value="" />

 

<input type="hidden" name="Quantity1" value="1" />

 

 

<input type="hidden" name="ProductLoopCounter2" id="ProductLoopCounter2" value="2" />

 

<input type="hidden" name="ProductID2" id="ProductID2" value="V3-1@@SHOP3" />

 

<input type="hidden" name="VariantID2" id="VariantID2" value="" />

 

<input type="hidden" name="UnitID2" id="UnitID2" value="" />

 

<input type="hidden" name="Quantity2" value="23" />

 

 

</form>

 
Morten Snedker
Reply
Sorry for not reading your post entirely:

If it stopped working after an update, you should create a case describing the problem and it will then be categorized as a bug - and be fixed.

Regards

Morten Snedker

 
Lucas Neessen
Reply

I can make a case for this that not a problem. Before I do that can you confirm that the form above is a valid way to post multiple items to a cart and this should result in a cart with 24 items?

Regards
Lucas
 
Morten Snedker
Reply
This post has been marked as an answer
I haven't tested it, but to me it appears to be valid as an end-result HTML being posted.

The template would look something like

<form name="multiForm" id="multiForm" method="post">
    <input type="hidden" name="CartCmd" id="CartCmd" value="addMulti" />
   <!--@LoopStart(Products)-->
       <!--@Ecom:Product.Form.Multi.HiddenFields-->
        <!--@Ecom:Product.Number--> - <!--@Ecom:Product.Name-->
        <!--@Ecom:Product.Price.Price--><br />
        <input type="text" name="Quantity!--@Ecom:Product.LoopCounter-->" value="0" />
    <!--@LoopEnd(Products)-->
</form> 

Also described here: http://engage.dynamicweb.dk/Adding-multiple-products-to-the-shopping-cart-195.aspx


Regards /Snedker

Votes for this answer: 0

 

You must be logged in to post in the forum