I have a requirement to specify some values for each item for sale. Imagine that you can add a gift message to each item in the basket individually.
How can this be achieved?
I am using nopCommerce 1.6 (for compatibility with .net 3.5).
I added three Product Attributes (Catalog> Products> Product Attributes). The created product and in the product variant added three attributes to the product by default.
The attributes are of type TextBox, which, I believe, will allow me to enter any value that I like as a string.
How to programmatically set these values. From what I can say, ShoppingCartManager.AddToCartit looks like this: as a fourth argument, a string containing XML for the attributes is required:
public static List<string> AddToCart(ShoppingCartTypeEnum shoppingCartType, int productVariantId, string selectedAttributes, decimal customerEnteredPrice, int quantity);
But I don’t see anything that explains how XML should be structured.
Please note: I am integrating with another CMS, so I do not use standard nopCommerce controls to display products.
source
share