Is there a reason why you did not use Product Attributes which are stored Automatically ? If you used Prodct Attributes then it would be automatically displayed on the product page, in the cart and in the order?
What does the DropDown value represent ? If you want to display the Drop down value in the Cart from a plugin then you need to make an override and new a new razor page. If you want to store the data you can either make a new table or store it in order.CustomValuesXml
Creating a table to store values is an advanced topic so you need to study the example provided above
To save a value in the order this is an example where I store the Payment Receipt No.
var order = _orderService.GetOrderById(order.Id); if (order == null) throw new NopException(string.Format("The order ID {0} doesn't exists", order.Id)); else { var processPaymentRequest = new ProcessPaymentRequest(); processPaymentRequest.CustomValues.Add("Payment Receipt No.", chargeInfo.ReceiptNumber); order.CustomValuesXml = _paymentService.SerializeCustomValues(processPaymentRequest); _orderService.UpdateOrder(order); }
Note: the values saved in order.CustomValuesXml will automatically be displayed on the customer account order details page which may or may not be helpful.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Vous avez encore des questions ou avez besoin d'aide?