Class SubscriptionBundleFindDiscountValuesHook
java.lang.Object
de.hybris.platform.subscriptionservices.subscription.impl.SubscriptionFindDiscountValuesHook
de.hybris.platform.subscriptionbundleservices.bundle.impl.SubscriptionBundleFindDiscountValuesHook
- All Implemented Interfaces:
FindDiscountValuesHook
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DiscountValuecreateDiscountValue(double discountPrice, double basePrice, String id, CurrencyModel currency) Creates a DiscountValue with an absolute reduction based on the givenbasePriceand the givendiscountPriceFind applicableDiscountValues for the target order entry.getDiscountValues(AbstractOrderEntryModel entry, AbstractOrderEntryModel masterEntry) booleanIndicates whether a custom base price can be found for the givenAbstractOrderEntryModel.protected voidreduceOneTimePrice(SubscriptionPricePlanModel pricePlan, ChangeProductPriceBundleRuleModel priceRule, 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, 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
-
Constructor Details
-
SubscriptionBundleFindDiscountValuesHook
public SubscriptionBundleFindDiscountValuesHook()
-
-
Method Details
-
findDiscountValues
Description copied from interface:FindDiscountValuesHookFind applicableDiscountValues for the target order entry.- Specified by:
findDiscountValuesin interfaceFindDiscountValuesHook- Overrides:
findDiscountValuesin classSubscriptionFindDiscountValuesHook- Returns:
- List of
DiscountValues
-
isApplicable
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 public List<DiscountValue> getDiscountValues(@Nonnull AbstractOrderEntryModel entry, @Nonnull AbstractOrderEntryModel masterEntry) -
reduceOneTimePrice
protected void reduceOneTimePrice(@Nonnull SubscriptionPricePlanModel pricePlan, @Nonnull ChangeProductPriceBundleRuleModel priceRule, @Nonnull 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, 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, String id, CurrencyModel currency) Creates a DiscountValue with an absolute reduction based on the givenbasePriceand the givendiscountPrice- Returns:
DiscountValue
-
getCommercePriceService
- Overrides:
getCommercePriceServicein classSubscriptionFindDiscountValuesHook
-
setCommercePriceService
- Overrides:
setCommercePriceServicein classSubscriptionFindDiscountValuesHook
-
getSubscriptionProductService
- Overrides:
getSubscriptionProductServicein classSubscriptionFindDiscountValuesHook
-
setSubscriptionProductService
- Overrides:
setSubscriptionProductServicein classSubscriptionFindDiscountValuesHook
-
getBundleRuleService
-
setBundleRuleService
-
getBundleTemplateService
-
setBundleTemplateService
-