Sets product unit price.
public setUnitPrice ( float $unitPrice ) | ||
$unitPrice | float |
/** * {@inheritdoc} */ public function updateComputationPricesFields(BasketInterface $basket, BasketElementInterface $basketElement, ProductInterface $product) { $unitPrice = $this->calculatePrice($product, $basket->getCurrency(), $product->isPriceIncludingVat(), 1); $price = $this->calculatePrice($product, $basket->getCurrency(), $product->isPriceIncludingVat(), $basketElement->getQuantity()); $basketElement->setUnitPrice($unitPrice); $basketElement->setPrice($price); $basketElement->setPriceIncludingVat($product->isPriceIncludingVat()); $basketElement->setVatRate($product->getVatRate()); }