Class ProductConfigAddToCartHookImpl

  • All Implemented Interfaces:
    CommerceAddToCartMethodHook

    public class ProductConfigAddToCartHookImpl
    extends java.lang.Object
    implements CommerceAddToCartMethodHook
    CPQ AddToCart hook.
    This hook is executed before and after addToCart. Main purpose is to ensure that there is a runtime configuration for each configurable product attached to the cart entry. This will already be the case if the add to cart action was triggered from the configuration screen. However if a configurable product is added to cart directly from catalog, without configuraing it beforehand, no runtime configuration exists, so the default configuration will be instantiated and attached to the cart item.
    Additionally this hook will ensure that the add to cart will always produce a new cart entry in case of configurable products. Merging two configurable products into one cart entry does not make sense, as they might have a different runtime configuration.