Developer forum

Forum » Ecommerce - Standard features » AddToList and Ecom

AddToList and Ecom

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I have created different lists as an Extranet-user on a webshop.

If I use GetString("Ecom:Product.AddToList") in my templates, the product is automatically added to the default list, when the user clicks the link.
Is it possible to have the customer select which list he wants the product added to?

I'm using DW9.

--
Best regards
Kurt Moskjaer Andersen
 


Replies

 
Konstantin Landyshev
Reply
This post has been marked as an answer

Hi, Kurt

To add some product in not default favorite list we use loop of all favorite lists

@foreach (LoopItem listType in GetLoop("CustomerCenter.ListTypes")) {
  foreach (LoopItem list in listType.GetLoop("CustomerCenter.ProductLists")) {
    <a href="@list.GetString("Ecom:Product.AddToThisListAction")">Add to list @list.GetValue("Ecom:CustomerCenter.List.Name")</a>
  }
}

Also you may need these tags for customizing your solution:
list.GetBoolean("Ecom:Product.List.IsProductInThisList")
list.GetString("Ecom:Product.RemoveFromThisList")

Feel free to ask any question!

Best regards
Konstantin Landyshev
Frontend developer

Votes for this answer: 1
 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Konstantin,

Perfect, thank you :)

/Kurt

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Konstantin, do you know if it is possible to add the quantity of the product to add?

/Kurt

 

You must be logged in to post in the forum