Class ProductConfigWorker


  • public final class ProductConfigWorker
    extends java.lang.Object
    Product Config Worker class to reduce code in templates.
    • Field Detail

      • module

        public static final java.lang.String module
    • Method Detail

      • storeProductConfigWrapper

        public static void storeProductConfigWrapper​(ProductConfigWrapper configWrapper,
                                                     Delegator delegator)
        First search persisted configurations and update configWrapper.configId if found. Otherwise store ProductConfigWrapper to ProductConfigConfig entity and updates configWrapper.configId with new configId This method persists only the selected options, price data is lost.
        Parameters:
        configWrapper - the ProductConfigWrapper object
        delegator - the delegator
      • loadProductConfigWrapper

        public static ProductConfigWrapper loadProductConfigWrapper​(Delegator delegator,
                                                                    LocalDispatcher dispatcher,
                                                                    java.lang.String configId,
                                                                    java.lang.String productId,
                                                                    java.lang.String productStoreId,
                                                                    java.lang.String catalogId,
                                                                    java.lang.String webSiteId,
                                                                    java.lang.String currencyUomId,
                                                                    java.util.Locale locale,
                                                                    GenericValue autoUserLogin)
        Creates a new ProductConfigWrapper for productId and configures it according to ProductConfigConfig entity with configId ProductConfigConfig entity stores only the selected options, and the product price is calculated from input params
        Parameters:
        delegator -
        dispatcher -
        configId - configuration Id
        productId - AGGRAGATED productId
        productStoreId - needed for price calculations
        catalogId - needed for price calculations
        webSiteId - needed for price calculations
        currencyUomId - needed for price calculations
        locale -
        autoUserLogin -
        Returns:
        ProductConfigWrapper