Class ProductConfigWorker


public final class ProductConfigWorker extends Object
Product Config Worker class to reduce code in templates.
  • Method Details

    • getProductConfigWrapper

      public static ProductConfigWrapper getProductConfigWrapper(String productId, String currencyUomId, HttpServletRequest request)
    • fillProductConfigWrapper

      public static void fillProductConfigWrapper(ProductConfigWrapper configWrapper, HttpServletRequest request)
    • 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.
      configWrapper - the ProductConfigWrapper object
      delegator - the delegator
    • loadProductConfigWrapper

      public static ProductConfigWrapper loadProductConfigWrapper(Delegator delegator, LocalDispatcher dispatcher, String configId, String productId, String productStoreId, String catalogId, String webSiteId, String currencyUomId, 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
      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 -