AdjustmentInterface.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Pricing\Adjustment;
  7. use Magento\Framework\Pricing\SaleableInterface;
  8. /**
  9. * Interface AdjustmentInterface
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. interface AdjustmentInterface
  15. {
  16. /**
  17. * Get adjustment code
  18. * (as declared in DI configuration)
  19. *
  20. * @return string
  21. */
  22. public function getAdjustmentCode();
  23. /**
  24. * Define if adjustment is included in base price
  25. *
  26. * @return bool
  27. */
  28. public function isIncludedInBasePrice();
  29. /**
  30. * Define if adjustment is included in display price
  31. *
  32. * @return bool
  33. */
  34. public function isIncludedInDisplayPrice();
  35. /**
  36. * Extract adjustment amount from the given amount value
  37. *
  38. * @param float $amount
  39. * @param SaleableInterface $saleableItem
  40. * @param null|array $context
  41. * @return float
  42. */
  43. public function extractAdjustment($amount, SaleableInterface $saleableItem, $context = []);
  44. /**
  45. * Apply adjustment amount and return result value
  46. *
  47. * @param float $amount
  48. * @param SaleableInterface $saleableItem
  49. * @param null|array $context
  50. * @return float
  51. */
  52. public function applyAdjustment($amount, SaleableInterface $saleableItem, $context = []);
  53. /**
  54. * Check if adjustment should be excluded from calculations along with the given adjustment
  55. *
  56. * @param string $adjustmentCode
  57. * @return bool
  58. */
  59. public function isExcludedWith($adjustmentCode);
  60. /**
  61. * Return sort order position
  62. *
  63. * @return int
  64. */
  65. public function getSortOrder();
  66. }