kentico_radekm
-
5/31/2011 1:23:47 AM
RE:Required Date field in Shopping Cart
Hello.
We solved it via e-mail, however I will post the solution here, so it can be used by someone else as well.
This is what I wrote:
In 5.5R2 (or older), you can accomplish it like this.
At first, you need to add custom column in Site Manager / Development / System tables / CMS_Order system table.
Then, you need to save value of your Calendar control into session, so you can get it from within later, when order is created, and save it into DB. This can be done in \CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCartPaymentShipping.ascx.cs, ProcessStep() method. You can access calendar´s day value via this.CustomCalendar.SelectedDate.Date.ToString(), where CustomCalendar is ID of my calendar control and save it into session via CMS.GlobalHelper.SessionHelper.SetValue(String, Object) method.
Then, you can get in from session via SessionHelper.GetValue(String). You can call this method in /CMSModules/Ecommerce/Controls/ShoppingCart/ShoppingCartPreview.ascx.cs (ProcessStep() method), after order is created.
Then, you need to get proper OrderInfo object via CMS.CMSEcommerce.OrderInfoProvider.GetOrderInfo(int OrderID) method, and use SetValue(“columnName”, value) on it. Like order.SetValue(“columnName”,value), where order is given OrderInfo object, and value is taken from session via SessionHelper.GetValue method.
If someone wants a code example, I can provide it. In this case, please send a message to support@kentico.com and refer to this forum post. Thank you.
Best Regards, Radek Macalik
|