Interface TmaPriceDataFactory

All Superinterfaces:
de.hybris.platform.commercefacades.product.PriceDataFactory, Serializable
All Known Implementing Classes:
DefaultTmaPriceDataFactory

public interface TmaPriceDataFactory extends de.hybris.platform.commercefacades.product.PriceDataFactory, Serializable
Custom implementation of the PriceDataFactory.
Since:
6.7
  • Method Details

    • create

      SubscriptionPricePlanData create(PriceDataType priceType, BigDecimal value, String currencyIso)
      Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.
      Specified by:
      create in interface de.hybris.platform.commercefacades.product.PriceDataFactory
      Parameters:
      priceType - price type of the resulting price data
      value - price amount
      currencyIso - currency ISO code determining the currency
      Returns:
      a newly created SubscriptionPricePlanData
    • create

      SubscriptionPricePlanData create(PriceDataType priceType, BigDecimal value, CurrencyModel currency)
      Creates a PriceData object with a formatted currency string based on the price type and currency.
      Specified by:
      create in interface de.hybris.platform.commercefacades.product.PriceDataFactory
      Parameters:
      priceType - price type of the resulting price data
      value - price amount
      currency - currency to be used by the price
      Returns:
      a newly created SubscriptionPricePlanData
    • getValueForPrice

      BigDecimal getValueForPrice(PriceData price)
      Retrieves the price value of a PriceData. The priorities are the following:
      • if the price has recurring charges, return the first recurring charge
      • if the price has a value, return the value
      • if the price has one time charges, return the first one time charge
      Parameters:
      price - price for which to retrieve the value
      Returns:
      price value considering the priorities mentioned above
    • getPriceDataTypeForProduct

      PriceDataType getPriceDataTypeForProduct(ProductModel product)
      Returns the PriceDataType for the given.
      Parameters:
      product - product to retrieve the price data type for
      Returns:
      price data type for the product given
    • formatPriceValue

      String formatPriceValue(BigDecimal value, CurrencyModel currency)
      Obtains a formatted string for the given price value and currency.
      Parameters:
      value - the price value
      currency - the currency
      Returns:
      formatted String with the price value and currency