API changes in Sitefinity CMS 5.3
This article contains changes in backward compatibility in the Sitefinity CMS 5.3 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
Inventory changes
New inventory features are added to the product. A couple of methods that were previously marked as obsolete in Sitefinity CMS 5.1 have been removed. The methods are the following:
- In OpenAccessOrdersDataProvider:
- public override void SetDetailInventoryAmount(CartDetail cartDetail)
- public override void SetDetailInventoryAmount(CartDetail cartDetail, Product product)
- In OrdersDataProvderBase:
- public abstract void SetDetailInventoryAmount(CartDetail cartDetail)
- public abstract void SetDetailInventoryAmount(CartDetail cartDetail, Product product)
Discounts changes
A new feature has been added to the discounts. It allows you to track the usage of discounts. In the upgrade process all existing discounts will be converted to be used as unlimited. If you have any discounts that were not upgraded, you can use the following code snippet to upgrade them:
var discounts = ordersManager.GetDiscounts().Where(d => d.IsActive);
foreach
(var discount
in
discounts)
{
if
(discount.Usage == 0 && discount.DiscountUsed == 0)
{
discount.Usage = -1;
//Set usage to maximum
}
}
ordersManager.SaveChanges();
For more information about discounts, read the For developers: Discounts.
Orders API changes
The following methods have been removed from the OrderCheckout class:
- DeterminePaymentProcessor
The method you must use instead is OrderProcessor.DeterminePaymentProcessor. - CapturePaymentResponse
The method you must use instead is OrderProcessor.CapturePaymentResponse.