kentico_zdenekc
-
12/15/2009 2:31:39 PM
RE:Production Options - Creating New Selection Type
Hello,
I understand your need but I am afraid it is not well supported now. It would require rather difficult customizations in the default e-commerce code.
First, you can add for example only one field of type boolean. This field can be then editable on the Custom fields for the product option. This would indicate if your control should be displayed or not.
Then, in the Shopping cart product option selector (\CMSModules\Ecommerce\Controls\ProductOptions\ShoppingCartItemSelector.ascx.cs) you will need to add the logic, which would check the value from the custom boolean field and display or hide your control.
In the mentioned file a method AddProductToShoppingCart() is used. There you can see that the URL is being built with the querystring parameters. So, you would need to add new parameter which would hold the data from your control, so they can be passed to the shopping cart itself. Then you would also need to modify the shopping cart steps to display the value(s) of this product option (that uses your selector).
Next thing would be to modify the interface in CMS Desk -> Tools -> Ecommerce so you will be able to see the control with values. You can add new field to some of the frames and you could use ShoppingCart.CustomData property to get the custom data.
Please note that this is a brief sketch of required changes, you solution may not need to store additional information, but only displaying of some custom data (ProductOptionCustomData). Anyway, your particular customization scenario would need some further analysis.
We are already planning to add ability to have more (and custom) product option selectors in one of the next versions. Currently, we cannot provide any easy solution. Thank you for understanding.
Regards, Zdenek C.
|