Migration Guide

See the information related to migrating your cart calculation logic from Jalo to the extensible cart calculation.

The service layer cart calculation is enabled by default in the SMART mode but this mode shouldn't be used for production environment. You should decide between the JALO and SL modes based on the information in this topic.

SMART Mode

During startup, you are informed in a log that this mode is enabled. This mode uses service layer but under certain circumstances it falls back to jalo. The information about falling back to jalo is logged at the INFO level to the console. Fallbacks to jalo take place in the following situations (be aware that not all customizations are recognized by the smart mode):

Customization Type

Customization Detection

Fallback to Jalo

Bean definition for currentFactoryFindPricingStrategy (defined in order-spring.xml in the Platform core) is overridden

After application startup

Permanent

Custom price factory is configured in the application

After application startup

Permanent

Custom price factory is set in the JaloSession

In runtime

Temporary

The SMART mode is more intended to detect scenarios where the code related to price API is customized using jalo.

JALO Mode

This mode doesn't require any adjustment. It doesn't bring any changes in the price/calculation API. Platform and extensions work with the calculation based on the implementation of the PriceFactory interface.

SL Mode

This mode enforces the use of the service layer calculation. If you use a customization code, you should adjust your code to this approach.

Below you can find scenarios of how you can migrate the JALO customization into the service layer solution. Be aware that in some cases it is not always possible to transition into the service layer solution.

The scenarios are applicable if you use DefaultCalculationService (the default Platform implementation for cart calculation):

Jalo Customization Scenario

Perform the steps to migrate you customization to service layer

Jalo PaymentMode/StandardPaymentMode item is extended and the PriceValue getCost(AbstractOrder) method is overridden.

  1. Create your own class implementation of the FindPaymentCostStrategy interface, or extend DefaultSLFindPaymentCostStrategy.

  2. Declare this class as a Spring bean and alias it with the name slFindPaymentCostStrategy.

Jalo DeliveryMode/ZoneDeliveryMode item is extended and the PriceValue getCost(AbstractOrder) method is overridden.

  1. Create your own class implementation of the FindDeliveryCostStrategy interface, or extend DefaultSLFindDeliveryCostStrategy.

  2. Declare this class as a Spring bean and alias it with the name slFindDeliveryCostStrategy.

Jalo Discount item is extended and the DiscountValue getDiscountValue(AbstractOrder) method is overridden.

  1. Create your own class implementation of the FindDiscountValuesStrategy interface, or extend DefaultSLFindOrderDiscountValuesStrategy.

  2. Declare this class as a Spring bean and alias it with the name slFindOrderDiscountValuesStrategy.

The bean definition for currentFactoryFindPricingStrategy (defined in order-spring.xml in the Platform core) is overridden in SAP Commerce or third-party extensions that you can't change.

Not supported. You have to use the JALO mode (switch pdt.calculation.mode to JALO).

The bean definition for currentFactoryFindPricingStrategy (defined in order-spring.xml in the Platform core) is overridden in your custom extension.

See information about extending the cart calculation mechanism in Processor Chains.

You use or extend a price factory other than the default implementation from extensions of SAP Commerce or third-party extensions that you can't change.

Not supported. Use the JALO mode (switch pdt.calculation.mode to JALO).

You are implementing the PriceFactory interface or extending the default implementation Europe1PriceFactory class - the methods related to resolving values/informations for price/discount/tax.

See information about extending the cart calculation mechanism in Processor Chains.

You are implementing the PriceFactory interface or extending the default implementation Europe1PriceFactory class and the boolean isNetUser(User user) method is implemented/overridden.

  1. Create your own class implementation of the UserNetCheckingStrategy interface.

  2. Declare this class as a Spring bean with the name slUserNetCheckingStrategy.