Developer forum

Forum » Templates » Add multiple products to cart from CustomerCenter

Add multiple products to cart from CustomerCenter

Aki Ruuskanen
Reply

Hi,

I am trying to add functionality to the wishlist so that the user can add all the products from a list to the cart. I am trying to do it the same way as you would do it in a regular productlist but it does not seem to work.

Any suggestions?

Regards / Aki

 


Replies

 
Mikkel Ricky
Reply

This is a bug with the content of the template tag @Ecom:Product.Form.Multi.HiddenFields (registered as Bug 15992).

As a workaround you can use

<form method="post">
  <!--@LoopStart(Ecom:CustomerCenter.List.ProductsList)-->

  <input type="hidden" name="ProductLoopCounter<!--@Ecom:Product.LoopCounter-->" value="<!--@Ecom:Product.LoopCounter-->" />
  <input type="hidden" name="ProductID<!--@Ecom:Product.LoopCounter-->" value="<!--@Ecom:Product.ID-->" />
  <input type="hidden" name="VariantID<!--@Ecom:Product.LoopCounter-->" value="<!--@Ecom:Product.VariantID-->" />

  <!--@Ecom:Product.Number--> - <!--@Ecom:Product.Name--> <!--@Ecom:Product.Price.Price--> <input type="text" name="Quantity<!--@Ecom:Product.LoopCounter-->" value="1" />
  <!--@LoopEnd(Ecom:CustomerCenter.List.ProductsList)-->

  <button type="submit" name="CartCmd" value="AddMulti">Add all</button>
</form>

rather than

<form method="post">
  <!--@LoopStart(Ecom:CustomerCenter.List.ProductsList)-->

  <!--@Ecom:Product.Form.Multi.HiddenFields-->

  <!--@Ecom:Product.Number--> - <!--@Ecom:Product.Name--> <!--@Ecom:Product.Price.Price--> <input type="text" name="Quantity<!--@Ecom:Product.LoopCounter-->" value="1" />
  <!--@LoopEnd(Ecom:CustomerCenter.List.ProductsList)-->

  <button type="submit" name="CartCmd" value="AddMulti">Add all</button>
</form>

Thanks for reporting this.

Best regards,
Mikkel

 

You must be logged in to post in the forum