Thanks. I saw those, but I don't know their structure, so I'm kind of at a loss about how to go about using those. I would LOVE a small snippet of code that starts with an Order object and returns the value of an attribute's name. Thanks in advance!
Inject ICheckoutAttributeParser in your controller. The implementation has a ParseCheckoutAttributes method that accepts attribute xml. You just need to pass order's attribute xml and you should be able to get relevant objects.
public MyService(ICheckoutAttributeParser checkoutAttributeService) { _checkoutAttributeService = checkoutAttributeService; }
...
var listOfCA = _checkoutAttributeService.ParseCheckoutAttributes(nopOrder.CheckoutAttributesXml);
foreach (var ca in listOfCA) { if (ca.Name.Equals("MyAttributeName")) { var caVals = _checkoutAttributeService.ParseValues(nopOrder.CheckoutAttributesXml, ca.Id);
// This isfor a textbox attribute. Other attribute types could require more manipulation to extract the value(s) var caValue = caVals[0]; } }
Hi i have a problem i created slot plugin for deliver so i want to use the slot in my order then for the delivery date(select box1) i wrote a function that get 7 days(from today to 7 after days) in the and for delivery time (select box2) i wrote query check the date in my slot table then i need to save values(date,time) in the checkoutattributevalue table but i dont know how save in the data base cos i think i change the function in the checkoutattributevalue