Shopping Form(Order Form)

benyamin jain asked on October 1, 2014 17:35

HI

Is it possible to have a form that user can fill it and then add it to shopping cart? OR better question : How we can offer a form to user then he/she can select our product and it's options then complete the shopping?

there are some situations that we can not define product as document type.

for example if we want to sell an Advertisement for a specific time we can not define advertisement as a document type, WHY? because this product or service has so many and variant options then it is better to offer a form instead of Document type. 1-user select type of AD. 2-user select display duration ($2 per month - there are another options) 3-user want have image gallery (2 cent per image) 4-based on number of selected images user must be able to upload his/her images . . n-1 : price calculated n : user submit order n+1: order added to shopping cart and user continue to pay the order

how it is possible to implement this scenario?

Recent Answers


Yehuda Lando answered on October 1, 2014 20:41

I did this using a custom shopping cart item selector control. Look at the default one at /CMSModules/Ecommerce/Controls/ProductOptions/ShoppingCartItemSelector.ascx, and change it to behave the way you want it to.

You will also need to change the shopping cart product detail transformation to use your custom control.

(This was done under Kentico 8.1, but it's probably the same.)

0 votesVote for this answer Mark as a Correct answer

benyamin jain answered on October 2, 2014 11:00

thakns for your reply could you please give in depth information about how you do it?

with best wishes benyamin

0 votesVote for this answer Mark as a Correct answer

Josef Dvorak answered on November 21, 2014 14:08

Hi Benyamin,

The method Yehuda described is the best one.

The SKU object representing Product data is separate from the TreeNode (Page) object. This means that it is perfectly possible to use it in the E-commerce module without the associated Page. In fact, once the Product is added to the Kentico Shopping Cart, only the SKU is used from that point forward. The relation to the actual Page is forgotten.

This means that to achieve your goal you will need to write your own web part that will present and customize the added product according to your needs. To add the item to shopping cart use code similar to method AddProductToShoppingCart from the ShoppingCartItemSelector control.

First, create a new instance of ShoppingCartItemParameters object and fill it with information about what item (SKUID), units and Product options (SKUIDs) should be added to the shopping cart. Afterwards, generate ShoppingCartItemInfo object using method ShoppingCart.SetShoppingCartItem(ShoppingCartItemParameters itemParams). And finally, save this new object to database using ShoppingCartItemInfoProvider.SetShoppingCartItemInfo(ShoppingCartItemInfo itemObj) method.

I recommend checking the code of the AddProductToShoppingCart method. Once you see it, it should be clear how an item is added to the Kentico Shopping Cart.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.