Kentico CMS 6.0 E-commerce Guide

Displaying product price

Displaying product price

Previous topic Next topic Mail us feedback on this topic!  

Displaying product price

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

Displaying product price on the website

 

The price is stored in the COM_SKU.SKUPrice field. The following method allows you to display the price in your transformation formatted according to the formatting string of the currently selected currency specified at CMS Desk -> E-commerce -> Configuration -> Currencies -> <edit currency> ->Currency formatting string:

 

GetSKUFormattedPrice(bool discounts, bool taxes)

 

bool discounts - indicates if price is displayed with the applied customer's discount level.

bool taxes - indicates if price is displayed with the applied taxes. Please note: computation of all product taxes is time-consuming. Therefore, the result is stored in the cache as specified at CMS Site Manager -> Settings -> website -> Cache content (minutes).

 

Example:

 

<%# GetSKUFormattedPrice(true, false) %>

 

All product prices are displayed in currency chosen according to the following priorities:

 

1. the currency of the shopping cart

2. the preferred currency of a customer

3. the default currency

 

Therefore, if the currency of the shopping cart is not set yet (the shopping cart hasn't been created so far), all product prices are displayed in the preferred currency of the given customer. If the customer doesn't specify the preferred currency, all product prices are displayed in the default currency.