Developer forum

Forum » Ecommerce - Standard features » In produclistview, how can i add amount of more than one to cart at the same time?

In produclistview, how can i add amount of more than one to cart at the same time?

Hans Ravnsfjall
Hans Ravnsfjall
Reply

See attachment

I want to be able to type in 20 in the inputfield, then clickk add to add an amount of 20 to the cart.

 

How can I do this? Do I have to modify the link of the add-button with an amount parameter?

 

/Hans

Skærmbillede_2019-02-13_kl._08.57.48.png

Replies

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

I have solved it like this-

 

it´s not pretty, but maybe someone has another suggestion?

 

@foreach (LoopItem item in GetLoop("Products")){
<div class="row">
  <div class="col-md-2">
@item.GetValue("Ecom:Product.Number")
  </div>
  <div class="col-md-6">
@item.GetValue("Ecom:Product.Name")
  </div>
  <div class="col-md-4">
    <form method="get">
    <input type="hidden" name="cartcmd" value="add" />
    <input type="hidden" name="id" value="@item.GetValue("Ecom:Product:Page.ID")" />
      <input type="hidden" name="productid" value="@item.GetValue("Ecom:Product.ID")" />
      <input name="Quantity" type="text" value="1" class="amount" style="width:30px; margin-right:10px;" />
      <input type="submit" value="Legg í kurv" />
  </form>
    
  </div>
</div>

}

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Hans,

 

You're looking for the addMulti feature. Check it here https://doc.dynamicweb.com/documentation-9/ecommerce/apps/shopping-cart#2948

 

There's also a bunch of forums posts if you search for "addMulti" and filter by 2017 and 2018

 

Best Regards,

Nuno Aguiar

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Thanx Nuno. Found some useful posts, and also found out that I have had issues with this before, because I solved it from an old forum post that i apparetly started myself :)

/Hans

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

You're welcome

 

You must be logged in to post in the forum