Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Is it possible to have a special function in E-commerce? View modes: 
User avatar
Member
Member
kevins-simpleid - 8/28/2012 2:00:56 AM
   
Is it possible to have a special function in E-commerce?
I am developing an E-commerce website. The client wants a “on sale” function. Now I create a field name “original price” and a checkbox “on sale”, if the “on sale” checkbox is ticked, the product is marked as special product. Than input the sale price in the “SKUPrice” field, and input the “price before reduce” in “original price” textbox, it works well.

But the client does not want to do that. The client wants it more simple, like the diagram below:

On Sale: (CheckBox here)
SKUPrice: (TextBox here)
SalePrice: (TextBox here)

If “on sale” check box is not ticked, the “SKUPrice” should be the real price. In this diagram, it means that the price you get by “GetSKUPrice” function should be 200.


If “on sale” check box is not ticked, the “Sale Price” should be the real price. In this diagram, it means that the price you get by “GetSKUPrice” function should be 150.
And in this situation, the SKUPrice should be displayed in “product detail” page as “Special: was 200”. This is not a problem for me.


According to my un understanding of Kentico E-commerce module, cause I cannot modify the dll file, I cannot find a way to achieve this. I just wonder is it possible in Kentico?

User avatar
Member
Member
kentico_davidb2 - 8/28/2012 5:09:54 AM
   
RE:Is it possible to have a special function in E-commerce?
Hi Kevin,

In order to achieve this functionality, you do not need to modify any dlls.

Supposing that you have version 6.0 and common install:

Firstly, you need to go to the CMS Site Manager - > Development -> System tables -> Ecommerce SKU and add your custom fields (e.g. SKUOnSale checkbox, SKUPriceOnSale), please remeber to check the Display attribute in the editing form option so that you can then imput the values when editing a product on the CMS Desk -> Ecommerce -> Products -your_product -> Custom fields.

It is also a good idea to check this option for the SKUPrice, so that you can see all the prices together.

Then, in the source code, please go to \App_Code\CMSModules\Ecommerce\Samples\CustomSKUInfoProvider.cs and modify the GetSKUPriceInternal with your logic.

Finally, in the source code, please go to \App_Code\CMSModules\Ecommerce\Samples\SampleECommerceModule.cs file and uncomment the line (approx 45) with code SKUInfoProvider.ProviderObject = new CustomSKUInfoProvider(); to register your custom code as stated at http://devnet.kentico.com/docs/ecommerceguide/index.html?custom_providers_overview.htm.

Should you need any additional details, please feel free to ask.

Best regards,

David Bednar
Support Engineer

User avatar
Member
Member
shenyi_1987-hotmail - 11/21/2012 6:59:13 PM
   
RE:Is it possible to have a special function in E-commerce?
Hello:

What if it is a version 5.5?

User avatar
Member
Member
kentico_davidb2 - 11/23/2012 3:28:52 AM
   
RE:Is it possible to have a special function in E-commerce?
Hi,

You need to use old custom provider approach for these versions as decribed at devnet.kentico.com/docs/5_5/ecommerceguide/index.html.

You will want to customize EvaluateShoppingCartContent method within devnet.kentico.com/docs/5_5/ecommerceguide/customshoppingcartinfoprovider.htm.

Dave

P.S. Please use appropriate forum for asking about different versions.