API changes in Sitefinity CMS 5.2
This article contains changes in backward compatibility in the Sitefinity CMS 5.2 release. Here you can find the following:
- Changes in the Ecommerce module
Read the whole article for detailed information about each of the changes.
Changes in the Ecommerce module
New multicurrency fields
With the newly introduced Multi-Currency feature all money related fields now have a corresponding ExchangeRate* fields. These should be used in all front end widgets (be it stock or custom).
Fields that have changed in the process are:
Orders table
New | Old |
ExchangeRateDiscountTotal | DiscountTotal |
ExchangeRatePreTaxTotal | PreTaxTotal |
ExchangeRateShippingTotal | ShippingTotal |
ExchangeRateSubTotalDisplay | SubTotalDisplay |
ExchangeRateSubTotal | SubTotal |
ExchangeRateTax | Tax |
ExchangeRateTotal | Total |
DefaultCurrency | Currency |
DefaultCurrencyInfo | CurrencyInfo |
OrderDetails table
New | Old |
ExchangeRateBasePrice | BasePrice |
ExchangeRatePrice | Price |
ExchangeRateBasePriceIncludingTax | |
OrderDiscounts table
New | Old |
ExchangeRateSavingAmount | SavingsAmount |
The ExchangeRate* fields are the values in the currency selected by the user. If multi-currency is not enabled on the site, then the ExchangeRate* fields are the values in the merchant’s currency. The “Old” properties are still being used. Their values are in the merchant’s default currency just as they were in the versions previous to 5.2.
New product fields
A new field in the product model has been introduced. It is called ClrType. Because this field will be used on the frontend for better performing queries, it is a mandatory field. To learn how to get the ClrType value for a product, see the following code snippet:
public
void
SetProductTypeClrType(Product contextProduct)
{
Type contextProductsType = contextProduct.GetType();
contextProduct.ClrType = contextProductsType.ToString();
}