Package de.hybris.platform.order
Interface DiscountService
-
- All Known Implementing Classes:
DefaultDiscountService
public interface DiscountServiceService around theDiscountModel.There are different kinds of discounts: absolute or relative, and global and non-global. Absolute discounts contain a real price value (price and currency), whereas relative discounts are discounts in percent. Global discounts are applied on order level, which means that they can not be applied to a single entry. Non-global discounts are only applicable on entry - level.
Since all price calculation is done be the currently installed pricefactory refer to it for maybe differing behavior.- Spring Bean ID:
- discountService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description DiscountModelgetDiscountForCode(java.lang.String code)Gets theDiscountModelwith the specified code.default java.util.List<DiscountInformation>getDiscountInformation(BaseCriteria baseCriteria)Get discountsDiscountInformations for given criteria.java.util.Collection<DiscountModel>getDiscountsForCode(java.lang.String matchedCode)Gets allDiscountModels which match the specified code.java.util.Collection<DiscountModel>getDiscountsForCurrency(CurrencyModel currency)Gets allDiscountModels which match the specified currency.
-
-
-
Method Detail
-
getDiscountForCode
DiscountModel getDiscountForCode(java.lang.String code)
Gets theDiscountModelwith the specified code.- Parameters:
code- the discount code- Returns:
- the found
DiscountModelwith the specified code
-
getDiscountsForCode
java.util.Collection<DiscountModel> getDiscountsForCode(java.lang.String matchedCode)
Gets allDiscountModels which match the specified code.- Parameters:
matchedCode- an SQL-Like statement as String, such as %discountCode%- Returns:
- the
Collectionof allDiscountModels which match the specified code
-
getDiscountsForCurrency
java.util.Collection<DiscountModel> getDiscountsForCurrency(CurrencyModel currency)
Gets allDiscountModels which match the specified currency.- Parameters:
currency- targetCurrencyModel- Returns:
- the
Collectionof allDiscountModels which matching currency. If no matching discounts were found, an empty collection is returned. - Throws:
java.lang.IllegalArgumentException- if currency is null
-
getDiscountInformation
default java.util.List<DiscountInformation> getDiscountInformation(BaseCriteria baseCriteria) throws CalculationException
Get discountsDiscountInformations for given criteria.- Parameters:
baseCriteria-BaseCriteria- Returns:
- the
Listof allDiscountInformations which matching baseCriteria. If no matching discounts were found, an empty collection is returned. - Throws:
CalculationException- if error occurred
-
-