You are here

public function PriceCalculatorInterface::calculate in Commerce Core 8.2

Calculates a purchasable entity's price.

Parameters

\Drupal\commerce\PurchasableEntityInterface $purchasable_entity: The purchasable entity.

string $quantity: The quantity.

\Drupal\commerce\Context $context: The context.

string[] $adjustment_types: The adjustment types to include in the calculated price. Examples: fee, promotion, tax.

Return value

\Drupal\commerce_order\PriceCalculatorResult The result.

1 method overrides PriceCalculatorInterface::calculate()
PriceCalculator::calculate in modules/order/src/PriceCalculator.php
Calculates a purchasable entity's price.

File

modules/order/src/PriceCalculatorInterface.php, line 55

Class

PriceCalculatorInterface
Calculates the price a purchasable entity would have if it was in an order.

Namespace

Drupal\commerce_order

Code

public function calculate(PurchasableEntityInterface $purchasable_entity, $quantity, Context $context, array $adjustment_types = []);