BundleCalculatorInterface.php 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Bundle\Pricing\Adjustment;
  7. use Magento\Catalog\Model\Product;
  8. use Magento\Framework\Pricing\Adjustment\CalculatorInterface;
  9. /**
  10. * Bundle calculator interface
  11. */
  12. interface BundleCalculatorInterface extends CalculatorInterface
  13. {
  14. /**
  15. * @param float|string $amount
  16. * @param Product $saleableItem
  17. * @param null|bool|string|array $exclude
  18. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  19. */
  20. public function getMaxAmount($amount, Product $saleableItem, $exclude = null);
  21. /**
  22. * @param float|string $amount
  23. * @param Product $saleableItem
  24. * @param null|bool|string|array $exclude
  25. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  26. */
  27. public function getMaxRegularAmount($amount, Product $saleableItem, $exclude = null);
  28. /**
  29. * @param float|string $amount
  30. * @param Product $saleableItem
  31. * @param null|bool|string|array $exclude
  32. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  33. */
  34. public function getMinRegularAmount($amount, Product $saleableItem, $exclude = null);
  35. /**
  36. * Option amount calculation for saleable item
  37. *
  38. * @param Product $saleableItem
  39. * @param null|bool|string|array $exclude
  40. * @param bool $searchMin
  41. * @param \Magento\Framework\Pricing\Amount\AmountInterface|null $bundleProductAmount
  42. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  43. */
  44. public function getOptionsAmount(
  45. Product $saleableItem,
  46. $exclude = null,
  47. $searchMin = true,
  48. $bundleProductAmount = null
  49. );
  50. /**
  51. * Calculate amount for bundle product with all selection prices
  52. *
  53. * @param float $basePriceValue
  54. * @param Product $bundleProduct
  55. * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList
  56. * @param null|bool|string|array $exclude code of adjustment that has to be excluded
  57. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  58. */
  59. public function calculateBundleAmount($basePriceValue, $bundleProduct, $selectionPriceList, $exclude = null);
  60. /**
  61. * Create selection price list for the retrieved options
  62. *
  63. * @param \Magento\Bundle\Model\Option $option
  64. * @param Product $bundleProduct
  65. * @param bool $useRegularPrice
  66. * @return \Magento\Bundle\Pricing\Price\BundleSelectionPrice[]
  67. */
  68. public function createSelectionPriceList($option, $bundleProduct, $useRegularPrice = false);
  69. /**
  70. * Find minimal or maximal price for existing options
  71. *
  72. * @param \Magento\Bundle\Model\Option $option
  73. * @param \Magento\Bundle\Pricing\Price\BundleSelectionPrice[] $selectionPriceList
  74. * @param bool $searchMin
  75. * @return \Magento\Bundle\Pricing\Price\BundleSelectionPrice[]
  76. */
  77. public function processOptions($option, $selectionPriceList, $searchMin = true);
  78. /**
  79. * @param float $amount
  80. * @param Product $saleableItem
  81. * @return \Magento\Framework\Pricing\Amount\AmountInterface
  82. */
  83. public function getAmountWithoutOption($amount, Product $saleableItem);
  84. }