Kartris User Guide

14.3. Custom product controls

Kartris has multiple product types, including 'options' products and text-customizations, which can handle most scenarios. However, some kinds of products, especially ones that are custom made, can't be adequately handled by the built in product types.

14.3.1. When to use custom product controls

A typical case where a customized product interface is required would be a site that makes items such as curtains and blinds. Both height and width could be any value (in centimetres) between perhaps 50 and 300, so it becomes impractical to create every possible width or height as an option. Furthermore, although options can have a price modifier associated with them, this doesn't really help with pricing where width and height are both variable.

Instead, a far more manageable solution would be for pricing to be obtained from a lookup table or a formula.

Situations where a highly customized product interface is also required or where a client side configuration system has already been created may lend themselves to custom product controls. For example, a client side tool that lets you design a t-shirt and add text and/or images, then buy the item.

14.3.2. Creating custom product controls

Kartris ships with a couple of sample custom controls in the /UserControls/Custom/ folder. There are comments within the files to help explain the code. Our examples are very simple in nature, but you can make things as complicated as necessary as long as you can dump a price and item description out of the control.

For example, you could have a control that has textboxes for the width and height of curtains, a dropdown menu of different lining types and then some other checkboxes for some further options. Prices could be looked up in an Excel spreadsheet with a table of curtain costs. This not only allows very fine control of pricing, but also makes it easy to change or update pricing by editing prices in the spreadsheet.

Engineering applications such as industrial fans could use either a 'black box' software component from the manufacturer or a web service to look up pricing based on various performance requirements, and return the fan specification as the item description, as well as the price.

14.3.3. Hooking up custom product controls

Once you have written your custom control, it is simple to incorporate it into Kartris. First, upload it to the /UserControls/Custom/ folder.

Next, create a new single version product. Give it an appropriate name, but price is not important as that will come later from the custom control.

Finally, edit the product and go to the object config tab. Enter the name of the control in the K:product.customcontrolname object config setting. For example: 'SampleCustomControl.ascx' (the .vb part will be linked in automatically).

When you view this product on the front end, you should now see your custom control providing most of the interface.

14.3.4. Further information

You can use a custom control from different products. So for example, in the case of a curtains web site, you can have each curtain set up with an image of the type of fabric, and then use the custom control on each curtain to handle pricing. You can also use per-product settings. So if the price per square metre of fabric is different for each product, you can set that at each product, and then just have the common values within the custom product control.

You can have as many custom controls as you need, so you can for example configure curtains and blinds using different custom controls within the same site, and of course mix in standard Kartris product types too.

As you can see from this simple overview, the custom product control support is extremely flexible and can cope with virtually any scenario.
 
powered by tomehost