Class ProductConfigurationPricingStrategyImpl
java.lang.Object
de.hybris.platform.sap.productconfig.services.impl.ProductConfigurationPricingStrategyImpl
- All Implemented Interfaces:
ProductConfigurationPricingStrategy
public class ProductConfigurationPricingStrategyImpl
extends Object
implements ProductConfigurationPricingStrategy
Default implementation for pricing for configurable products
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculates the current base price for a given abstract order entry.protected PriceModelprotected PriceValueprotected CommerceCartServiceprotected ConfigurationCopyStrategyprotected Stringprotected ProductConfigurationServiceprotected CommonI18NServiceprotected ModelServiceprotected CommerceCartParameterprotected PricingServiceprotected booleanprotected DoublehasBasePriceChanged(AbstractOrderEntryModel entry, PriceModel newPrice) booleanisCartPricingErrorPresent(ConfigModel configModel) Indicates whether there is a problem to obtain correct prices for cart/orderprotected booleanisSessionCurrencyMatching(String priceCurrencyIso) protected voidrecreateConfigurationWithCurrentCurrency(String configId, AbstractOrderEntryModel entry, boolean draft) protected PriceModelprotected PriceModelretrieveCurrentTotalPrice(String configId, AbstractOrderEntryModel entry) voidsetCommerceCartService(CommerceCartService commerceCartService) voidsetConfigCopyStrategy(ConfigurationCopyStrategy configCopyStrategy) voidsetConfigurationAbstractOrderEntryLinkStrategy(ConfigurationAbstractOrderEntryLinkStrategy configurationAbstractOrderEntryLinkStrategy) voidsetConfigurationAbstractOrderIntegrationStrategy(ConfigurationAbstractOrderIntegrationStrategy configurationAbstractOrderIntegrationStrategy) voidsetConfigurationService(ProductConfigurationService configurationService) voidsetI18NService(CommonI18NService i18nService) voidsetModelService(ModelService modelService) voidsetPricingService(PricingService pricingService) booleanupdateCartEntryPrices(AbstractOrderEntryModel entry, boolean calculateCart, CommerceCartParameter passedParameter) Updates cart entry's base price (in case it deviates from the current configuration price) from configuration model/pricing service.protected voidvalidateCurrency(PriceModel price)
-
Constructor Details
-
ProductConfigurationPricingStrategyImpl
public ProductConfigurationPricingStrategyImpl()
-
-
Method Details
-
calculateBasePriceForConfiguration
Description copied from interface:ProductConfigurationPricingStrategyCalculates the current base price for a given abstract order entry. Note that this price is derived from the configuration and may differ from the one persisted on the cart entry. In this case the cart entry price is outdated. ConfigId has to be present in current session for given cart entry to retrieve configuration model and prices.- Specified by:
calculateBasePriceForConfigurationin interfaceProductConfigurationPricingStrategy- Parameters:
entry- entry which has an associated product configuration- Returns:
- current base price
-
createZeroPrice
-
calculateBasePriceModelForConfiguration
-
getConfigIdForCartEntry
-
hasBasePriceChanged
-
hasBasePriceChanged
-
updateCartEntryPrices
public boolean updateCartEntryPrices(AbstractOrderEntryModel entry, boolean calculateCart, CommerceCartParameter passedParameter) Description copied from interface:ProductConfigurationPricingStrategyUpdates cart entry's base price (in case it deviates from the current configuration price) from configuration model/pricing service. ConfigId has to be present in current session for given cart entry to retrieve configuration model. This includes recalculation and saving of the cart if entry prices were updated.- Specified by:
updateCartEntryPricesin interfaceProductConfigurationPricingStrategy- Parameters:
entry- cart entrycalculateCart- specifies whether cart is calculated on successful updatepassedParameter- parameters for recalculation of the cart- Returns:
- true if cart entry has been updated
-
getParametersForCartUpdate
-
retrieveCurrentTotalPrice
-
validateCurrency
-
recreateConfigurationWithCurrentCurrency
protected void recreateConfigurationWithCurrentCurrency(String configId, AbstractOrderEntryModel entry, boolean draft) -
reloadCurrentTotalWithCurrentCurrency
-
isSessionCurrencyMatching
-
isCartPricingErrorPresent
Description copied from interface:ProductConfigurationPricingStrategyIndicates whether there is a problem to obtain correct prices for cart/order- Specified by:
isCartPricingErrorPresentin interfaceProductConfigurationPricingStrategy- Parameters:
configModel- configuration model that represents the runtime state of the configuration- Returns:
- true if no prices can be obtained at the moment
-
getConfigurationService
-
getPricingService
-
getCommerceCartService
-
getModelService
-
getAbstractOrderEntryLinkStrategy
-
getI18NService
-
getConfigCopyStrategy
-
setConfigurationService
-
setPricingService
-
setCommerceCartService
-
setModelService
-
setConfigurationAbstractOrderEntryLinkStrategy
public void setConfigurationAbstractOrderEntryLinkStrategy(ConfigurationAbstractOrderEntryLinkStrategy configurationAbstractOrderEntryLinkStrategy) -
setConfigCopyStrategy
-
setI18NService
-
getConfigurationAbstractOrderIntegrationStrategy
protected ConfigurationAbstractOrderIntegrationStrategy getConfigurationAbstractOrderIntegrationStrategy() -
setConfigurationAbstractOrderIntegrationStrategy
public void setConfigurationAbstractOrderIntegrationStrategy(ConfigurationAbstractOrderIntegrationStrategy configurationAbstractOrderIntegrationStrategy)
-