Class SubscriptionBundleFindDiscountValuesHook
- java.lang.Object
-
- de.hybris.platform.subscriptionservices.subscription.impl.SubscriptionFindDiscountValuesHook
-
- de.hybris.platform.subscriptionbundleservices.bundle.impl.SubscriptionBundleFindDiscountValuesHook
-
- All Implemented Interfaces:
FindDiscountValuesHook
public class SubscriptionBundleFindDiscountValuesHook extends SubscriptionFindDiscountValuesHook
-
-
Constructor Summary
Constructors Constructor Description SubscriptionBundleFindDiscountValuesHook()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DiscountValuecreateDiscountValue(double discountPrice, double basePrice, java.lang.String id, CurrencyModel currency)Creates a DiscountValue with an absolute reduction based on the givenbasePriceand the givendiscountPricejava.util.List<DiscountValue>findDiscountValues(AbstractOrderEntryModel entry)Find applicableDiscountValues for the target order entry.BundleRuleServicegetBundleRuleService()BundleTemplateServicegetBundleTemplateService()SubscriptionCommercePriceServicegetCommercePriceService()protected java.util.List<DiscountValue>getDiscountValues(AbstractOrderEntryModel entry, AbstractOrderEntryModel masterEntry)SubscriptionProductServicegetSubscriptionProductService()booleanisApplicable(AbstractOrderEntryModel entry)Indicates whether a custom base price can be found for the givenAbstractOrderEntryModel.protected voidreduceOneTimePrice(SubscriptionPricePlanModel pricePlan, ChangeProductPriceBundleRuleModel priceRule, java.util.List<DiscountValue> discountValues, CurrencyModel currency, AbstractOrderEntryModel entry)The price logic for subscription product: discount are applied to one time charge.protected voidreduceRecurringPrice(ProductModel subscriptionProduct, ChangeProductPriceBundleRuleModel priceRule, java.util.List<DiscountValue> discountValues, AbstractOrderEntryModel entry, SubscriptionPricePlanModel pricePlan)hard coded price logic for subscription products: discounts are only applied to recurring pricesvoidsetBundleRuleService(BundleRuleService bundleRuleService)voidsetBundleTemplateService(BundleTemplateService bundleTemplateService)voidsetCommercePriceService(SubscriptionCommercePriceService commercePriceService)voidsetSubscriptionProductService(SubscriptionProductService subscriptionProductService)-
Methods inherited from class de.hybris.platform.subscriptionservices.subscription.impl.SubscriptionFindDiscountValuesHook
getDiscountValuesWhenBillingFrequency
-
-
-
-
Method Detail
-
findDiscountValues
public java.util.List<DiscountValue> findDiscountValues(AbstractOrderEntryModel entry)
Description copied from interface:FindDiscountValuesHookFind applicableDiscountValues for the target order entry.- Specified by:
findDiscountValuesin interfaceFindDiscountValuesHook- Overrides:
findDiscountValuesin classSubscriptionFindDiscountValuesHook- Returns:
- List of
DiscountValues
-
isApplicable
public boolean isApplicable(AbstractOrderEntryModel entry)
Description copied from interface:FindDiscountValuesHookIndicates whether a custom base price can be found for the givenAbstractOrderEntryModel.- Specified by:
isApplicablein interfaceFindDiscountValuesHook- Overrides:
isApplicablein classSubscriptionFindDiscountValuesHook- Parameters:
entry-AbstractOrderEntryModel- Returns:
- whether hook is applicable
-
getDiscountValues
@Nonnull protected java.util.List<DiscountValue> getDiscountValues(@Nonnull AbstractOrderEntryModel entry, @Nonnull AbstractOrderEntryModel masterEntry)
-
reduceOneTimePrice
protected void reduceOneTimePrice(@Nonnull SubscriptionPricePlanModel pricePlan, @Nonnull ChangeProductPriceBundleRuleModel priceRule, @Nonnull java.util.List<DiscountValue> discountValues, @Nonnull CurrencyModel currency, @Nonnull AbstractOrderEntryModel entry)The price logic for subscription product: discount are applied to one time charge.- Parameters:
pricePlan- the subscription price planpriceRule- the change product price bundle rulediscountValues- the discount values listcurrency- the currencyentry- the order entry
-
reduceRecurringPrice
protected void reduceRecurringPrice(ProductModel subscriptionProduct, ChangeProductPriceBundleRuleModel priceRule, java.util.List<DiscountValue> discountValues, AbstractOrderEntryModel entry, SubscriptionPricePlanModel pricePlan)
hard coded price logic for subscription products: discounts are only applied to recurring prices- Parameters:
subscriptionProduct- the subscription productpriceRule- the change product price bundle rulediscountValues- the discount values listentry- the order entrypricePlan- the subscription price plan
-
createDiscountValue
protected DiscountValue createDiscountValue(double discountPrice, double basePrice, java.lang.String id, CurrencyModel currency)
Creates a DiscountValue with an absolute reduction based on the givenbasePriceand the givendiscountPrice- Returns:
DiscountValue
-
getCommercePriceService
public SubscriptionCommercePriceService getCommercePriceService()
- Overrides:
getCommercePriceServicein classSubscriptionFindDiscountValuesHook
-
setCommercePriceService
public void setCommercePriceService(SubscriptionCommercePriceService commercePriceService)
- Overrides:
setCommercePriceServicein classSubscriptionFindDiscountValuesHook
-
getSubscriptionProductService
public SubscriptionProductService getSubscriptionProductService()
- Overrides:
getSubscriptionProductServicein classSubscriptionFindDiscountValuesHook
-
setSubscriptionProductService
public void setSubscriptionProductService(SubscriptionProductService subscriptionProductService)
- Overrides:
setSubscriptionProductServicein classSubscriptionFindDiscountValuesHook
-
getBundleRuleService
public BundleRuleService getBundleRuleService()
-
setBundleRuleService
public void setBundleRuleService(BundleRuleService bundleRuleService)
-
getBundleTemplateService
public BundleTemplateService getBundleTemplateService()
-
setBundleTemplateService
public void setBundleTemplateService(BundleTemplateService bundleTemplateService)
-
-