Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Datetime picker View modes: 
User avatar
Member
Member
heybro-yopmail - 5/2/2012 10:14:14 AM
   
Datetime picker
Hey!

I'm using the datetimepicker tag in a asp file with an id (<cms:DateTimePicker Id="timepickerid" ...), and I'm totally unable to get the data entered in the cs file.

I was expecting a "Value" (or something else) method on the object "timepickerid" in order to get the data, and to set it / convert it into datetime format.

How can I manage to get this data into a DateTime format?

Cheers

User avatar
Kentico Support
Kentico Support
kentico_radekm2 - 5/2/2012 11:03:40 PM
   
RE:Datetime picker
Hello.

Could you please try following property?

...
myDTP.DateTimeTextBox.Text;
...

Where "myDTP" is ID of the control.

Best Regards,
Radek Macalik

User avatar
Member
Member
heybro-yopmail - 5/3/2012 4:15:53 AM
   
RE:Datetime picker
Hello.

Thanks for your reply Radek.
I'm still having issues even with using the property, I'll explain clearly what I want to do.

I added a new attribute in the ECommerce Shopping Cart system table with a Date&Time type.
I want to set this attribute in the checkout process so I add a new step where I can set the value (with the <cms:DateTimePicker id="myDTP"..).
In the CS file, in the Process Step method I put you what you gave me :
ShoppingCartInfoObj.SetValue("mycolumnname", myDTP.DateTimeTextBox.Text);

In the next step, I'd like to check if the value was correctly set as it is supposed to be a DateTime format, so in a label I'm using ShoppingCartInfoObj.GetDateTimeValue("mycolumnname", DateTime.Now).ToString());
It doesnt work as it always returns the value of now..

The issue comes from the setValue..

User avatar
Member
Member
heybro-yopmail - 5/3/2012 5:44:52 AM
   
RE:Datetime picker
heybro-yopmail wrote: Hello.

Thanks for your reply Radek.
I'm still having issues even with using the property, I'll explain clearly what I want to do.


Seems to be fixed right now with the SetValue property!

Now, other thing, my new attribute in the ShoppingCart system table has to be linked with an attribute created in the Order system table when the shopping cart is converted into an order to
I searched in the web solution and found something in ECommerceHelper, TrackOrderConversion function seems to be the right, but how can I override it or try to add a parameter to it ?

Cheers

User avatar
Member
Member
kentico_michal - 5/6/2012 6:54:41 AM
   
RE:Datetime picker
Hi,

The TrackOrderConversion method logs conversion related to the on-line marketing functionality.

If you need to extend your the order with som custom field, you can override the ShoppingCartInfoProvider.SetOrder method just as it is described in this blog: E-commerce 6-New customization model.

Within the overriden method, you can call the base SetOrderInternal method to ensure the standard functionality. Once you have done so, you can retrieve the order with the help of the OrderInfoProvider.GetOrderInfo(ShoppingCartInfo.OrderId) method and specify a custom property if necessary using the OrderInfo.SetValue method.


Best regards,
Michal Legen

User avatar
Member
Member
heybro-yopmail - 5/7/2012 7:45:14 AM
   
RE:Datetime picker
Thanks very much Michal!

Works great!
Following the blog's link I was wondering if to "enable" my new provider I had to add lines in the web.config or/and create a ModuleLoader, I tried both and found that these 2 means are possible.

Which one do you recommend the most ?

Cheers

User avatar
Member
Member
kentico_michal - 5/9/2012 7:50:00 AM
   
RE:Datetime picker
Hi,

Registration can be done either programmatically or using the web.config file. The result is the same. So, it really depends on which approach suits you best.

Best regards,
Michal Legen