|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (CalculatorBase $calculator, AmountFactory $amountFactory, BundleSelectionFactory $bundleSelectionFactory, TaxHelper $taxHelper, PriceCurrencyInterface $priceCurrency, SelectionPriceListProviderInterface $selectionPriceListProvider=null) | |
| getAmount ($amount, SaleableInterface $saleableItem, $exclude=null, $context=[]) | |
| getMinRegularAmount ($amount, Product $saleableItem, $exclude=null) | |
| getMaxAmount ($amount, Product $saleableItem, $exclude=null) | |
| getMaxRegularAmount ($amount, Product $saleableItem, $exclude=null) | |
| getOptionsAmount (Product $saleableItem, $exclude=null, $searchMin=true, $baseAmount=0., $useRegularPrice=false) | |
| getAmountWithoutOption ($amount, Product $saleableItem) | |
| calculateBundleAmount ($basePriceValue, $bundleProduct, $selectionPriceList, $exclude=null) | |
| createSelectionPriceList ($option, $bundleProduct, $useRegularPrice=false) | |
| processOptions ($option, $selectionPriceList, $searchMin=true) | |
Public Member Functions inherited from BundleCalculatorInterface | |
| getOptionsAmount (Product $saleableItem, $exclude=null, $searchMin=true, $bundleProductAmount=null) | |
Protected Member Functions | |
| getSelectionAmounts (Product $bundleProduct, $searchMin, $useRegularPrice=false) | |
| canSkipOption ($option, $canSkipRequiredOption) | |
| hasRequiredOption ($bundleProduct) | |
Protected Attributes | |
| $calculator | |
| $amountFactory | |
| $selectionFactory | |
| $taxHelper | |
| $priceCurrency | |
Bundle price calculator @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 24 of file Calculator.php.
| __construct | ( | CalculatorBase | $calculator, |
| AmountFactory | $amountFactory, | ||
| BundleSelectionFactory | $bundleSelectionFactory, | ||
| TaxHelper | $taxHelper, | ||
| PriceCurrencyInterface | $priceCurrency, | ||
| SelectionPriceListProviderInterface | $selectionPriceListProvider = null |
||
| ) |
| CalculatorBase | $calculator | |
| AmountFactory | $amountFactory | |
| BundleSelectionFactory | $bundleSelectionFactory | |
| TaxHelper | $taxHelper | |
| PriceCurrencyInterface | $priceCurrency | |
| SelectionPriceListProviderInterface | null | $selectionPriceListProvider |
Definition at line 71 of file Calculator.php.
| calculateBundleAmount | ( | $basePriceValue, | |
| $bundleProduct, | |||
| $selectionPriceList, | |||
$exclude = null |
|||
| ) |
Calculate amount for bundle product with all selection prices
| float | $basePriceValue | |
| Product | $bundleProduct | |
Implements BundleCalculatorInterface.
Definition at line 270 of file Calculator.php.
|
protected |
Check this option if it should be skipped
| \Magento\Bundle\Model\Option | $option | |
| bool | $canSkipRequiredOption |
Definition at line 222 of file Calculator.php.
| createSelectionPriceList | ( | $option, | |
| $bundleProduct, | |||
$useRegularPrice = false |
|||
| ) |
Create selection price list for the retrieved options
| \Magento\Bundle\Model\Option | $option | |
| Product | $bundleProduct | |
| bool | $useRegularPrice |
Implements BundleCalculatorInterface.
Definition at line 372 of file Calculator.php.
| getAmount | ( | $amount, | |
| SaleableInterface | $saleableItem, | ||
$exclude = null, |
|||
$context = [] |
|||
| ) |
Get amount for current product which is included price of existing options with minimal price
| float | string | $amount | |
| SaleableInterface | $saleableItem | |
| null | bool | string | array | $exclude | |
| null | array | $context |
Implements CalculatorInterface.
Definition at line 97 of file Calculator.php.
| getAmountWithoutOption | ( | $amount, | |
| Product | $saleableItem | ||
| ) |
Get base amount without option
| float | $amount | |
| Product | $saleableItem |
Implements BundleCalculatorInterface.
Definition at line 178 of file Calculator.php.
| getMaxAmount | ( | $amount, | |
| Product | $saleableItem, | ||
$exclude = null |
|||
| ) |
Get amount for current product which is included price of existing options with maximal price
| float | $amount | |
| Product | $saleableItem | |
| null | bool | string | array | $exclude |
Implements BundleCalculatorInterface.
Definition at line 123 of file Calculator.php.
| getMaxRegularAmount | ( | $amount, | |
| Product | $saleableItem, | ||
$exclude = null |
|||
| ) |
Get amount for current product which is included price of existing options with maximal price
| float | $amount | |
| Product | $saleableItem | |
| null | bool | string | array | $exclude |
Implements BundleCalculatorInterface.
Definition at line 136 of file Calculator.php.
| getMinRegularAmount | ( | $amount, | |
| Product | $saleableItem, | ||
$exclude = null |
|||
| ) |
Get amount for current product which is included price of existing options with maximal price
| float | $amount | |
| Product | $saleableItem | |
| null | bool | string | array | $exclude |
Implements BundleCalculatorInterface.
Definition at line 110 of file Calculator.php.
| getOptionsAmount | ( | Product | $saleableItem, |
$exclude = null, |
|||
$searchMin = true, |
|||
$baseAmount = 0., |
|||
$useRegularPrice = false |
|||
| ) |
Option amount calculation for bundle product
| Product | $saleableItem | |
| null | bool | string | array | $exclude | |
| bool | $searchMin | |
| float | $baseAmount | |
| bool | $useRegularPrice |
Definition at line 151 of file Calculator.php.
Filter all options for bundle product
| Product | $bundleProduct | |
| bool | $searchMin | |
| bool | $useRegularPrice |
Definition at line 195 of file Calculator.php.
|
protected |
Check the bundle product for availability of required options
| Product | $bundleProduct |
Definition at line 234 of file Calculator.php.
| processOptions | ( | $option, | |
| $selectionPriceList, | |||
$searchMin = true |
|||
| ) |
Find minimal or maximal price for existing options
| \Magento\Bundle\Model\Option | $option | |
Implements BundleCalculatorInterface.
Definition at line 406 of file Calculator.php.
|
protected |
Definition at line 34 of file Calculator.php.
|
protected |
Definition at line 29 of file Calculator.php.
|
protected |
Definition at line 51 of file Calculator.php.
|
protected |
Definition at line 39 of file Calculator.php.
|
protected |
Definition at line 46 of file Calculator.php.