Previous Topic

Book Contents

Book Index

Next Topic

Miscellaneous Hints

How to redefine the calculation quickly for demo

The easiest way to change the calculation completely is to overload the standard library function.

  • Copy the ‘pricingOffer_CalculateShopAdditionalInfo()’ function (used in the configurator) or the ‘reqitem_calculateShopAdditionalInfo()’ function (used for the cart) from the ‘APC.srs’ workflow node to the ‘APC_cust.srs’ workflow node.
  • Do not change the function name. Change only the body of your new function, e.g. try first to change the order of the standard calculated parts of additional info.

How to use your own additional attributes

In the previous examples we only changed calculations for standard transient attributes named ‘shopAdditionalInfo’ which are mapped to the ‘Additional Info’ field on the GUI. It may also be advisable to assign your new calculation to a new transient attribute (e.g. ‘xShopAdditionalInfo’). This way you will see both the standard and the non-standard Additional Info side by side in two attributes, giving you the possibility to compare the results or switch GUI mapping between the attributes easily e.g. when dealing with future changes of the standard calculation. However, you will need to map your new attribute to the shop GUI field (e.g. by overriding the standard mapping functions – which can be done by copying the ‘getShop…Mapping…()’ function from the ‘APC.srs’ module to the ‘APC_cust.srs’ module.)

How to add info dynamically dependent on other options in the configurator

In the static examples above only calculations for 2 attributes were edited: ‘PricingOffer.shopAdditionalInfo’ and ‘Reqitem. shopAdditionalInfo’. Calculation for the third attribute ‘ProductSelectorOption.shopAdditionalInfo’ simply used the value from ‘PricingOffer.shopAdditionalInfo’.

Only in a very complicated case - when the info in one configured option in the configurator should dynamically change depending on the selection of other options within a complex product - we need to change the ‘ProductSelectorOption.shopAdditionalInfo’ attribute. Then it is possible to change the calculation in such a way that it collects some dynamic information calculated ProductSelectorOption, which contains dynamic information from the currently selected data in the shop. This dynamic information can be calculated by another calculation (preferably) or in workflows when a ProductSelectorOption is created and when the selection or quantity is changed (workflows ‘productselectoroption_select, productselectoroption_afterChangeQuantityPerParent’).

See Also

Displaying Additional Information in the Shop

How to Remove Additional Info

How to Add More Info

How to Redefine the Calculation