ProductPriceController
extends ProductCommonController
in package
This controller describes the behavior of Product Price interval entities.
Use the controller to generate a collection of CollectionPriceInterval entities. This controller is required in order to get prices of products.
Tags
Table of Contents
- __construct() : mixed
- amountIntervals() : array<string|int, mixed>
- Calculates a combination of amount intervals for both price lines and discount lines
- calculateSortingLine() : mixed
- Calculates a price for sorting in the product list
- filterDiscountLines() : array<string|int, DiscountLine>
- Filters the general discount lines using the current params, and only leaves valid lines
- filterPriceLines() : array<string|int, DiscountLine>
- Filters the general price lines using the current params, and only leaves valid lines
- getPaymentOptions() : mixed
- Legacy, do not use this method
- getUnitTitle() : string
- Get the title of a product entity
- massDiscountLines() : array<string|int, mixed>
- Support method to fetch discount lines from the cache
- maxDiscountLine() : entity
- Given an array of price lines, this method returns the last item
- minPrice() : CollectionPriceInterval
- Calculate the price of the priceline with the smallest Amount combined with the biggest valid discount line matching this Amount
- minPriceLine() : float
- Given a specific array of interval lines, this method will return the lowest price
- priceIntervals() : array<string|int, mixed>
- Calculates the price intervals of a product or variant
Methods
__construct()
public
__construct([mixed $parseUriParameters = false ]) :
mixed
Parameters
- $parseUriParameters : mixed = false
Tags
Return values
mixed —amountIntervals()
Calculates a combination of amount intervals for both price lines and discount lines
public
amountIntervals(mixed $priceLines, mixed $discountLines) :
array<string|int, mixed>
Parameters
- $priceLines : mixed
- $discountLines : mixed
Tags
Return values
array<string|int, mixed> —An array with keys consisting of the combined amount intervals
calculateSortingLine()
Calculates a price for sorting in the product list
public
calculateSortingLine(mixed $priceLineGroups, mixed $discountLineGroups, mixed $params, mixed $settings) :
mixed
Parameters
- $priceLineGroups : mixed
- $discountLineGroups : mixed
- $params : mixed
- $settings : mixed
Tags
Return values
mixed —filterDiscountLines()
Filters the general discount lines using the current params, and only leaves valid lines
public
filterDiscountLines(mixed $discountLines, mixed $params) :
array<string|int, DiscountLine>
Parameters
- $discountLines : mixed
- $params : mixed
Tags
Return values
array<string|int, DiscountLine> —filterPriceLines()
Filters the general price lines using the current params, and only leaves valid lines
public
filterPriceLines(mixed $priceLines, mixed $params) :
array<string|int, DiscountLine>
Parameters
- $priceLines : mixed
- $params : mixed
Tags
Return values
array<string|int, DiscountLine> —getPaymentOptions()
Legacy, do not use this method
public
getPaymentOptions(mixed $Price) :
mixed
Parameters
- $Price : mixed
Tags
Return values
mixed —getUnitTitle()
Get the title of a product entity
public
getUnitTitle(mixed $UnitId[, mixed $LanguageIso = null ]) :
string
Parameters
- $UnitId : mixed
- $LanguageIso : mixed = null
Tags
Return values
string —massDiscountLines()
Support method to fetch discount lines from the cache
public
massDiscountLines() :
array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —maxDiscountLine()
Given an array of price lines, this method returns the last item
public
maxDiscountLine(mixed $lines) : entity
Parameters
- $lines : mixed
Tags
Return values
entity —minPrice()
Calculate the price of the priceline with the smallest Amount combined with the biggest valid discount line matching this Amount
public
minPrice(mixed $priceLines, mixed $discountLines) : CollectionPriceInterval
Parameters
- $priceLines : mixed
- $discountLines : mixed
Tags
Return values
CollectionPriceInterval —minPriceLine()
Given a specific array of interval lines, this method will return the lowest price
public
minPriceLine(mixed $lines[, mixed $SpecificAmount = null ]) :
float
Parameters
- $lines : mixed
- $SpecificAmount : mixed = null
Tags
Return values
float —The lowest price
priceIntervals()
Calculates the price intervals of a product or variant
public
priceIntervals(mixed $priceLineGroups, mixed $discountLineGroups, mixed $params, mixed $settings[, mixed $productId = null ]) :
array<string|int, mixed>
Parameters
- $priceLineGroups : mixed
- $discountLineGroups : mixed
- $params : mixed
- $settings : mixed
- $productId : mixed = null
Tags
Return values
array<string|int, mixed> —A single array consisting of (amount, pricemin, fullpricemin, pricemax, fullpricemax) objects