Sonata\ProductBundle\Model\BaseProductProvider::updateComputationPricesFields PHP Метод

updateComputationPricesFields() публичный Метод

public updateComputationPricesFields ( Sonata\Component\Basket\BasketInterface $basket, Sonata\Component\Basket\BasketElementInterface $basketElement, Sonata\Component\Product\ProductInterface $product )
$basket Sonata\Component\Basket\BasketInterface
$basketElement Sonata\Component\Basket\BasketElementInterface
$product Sonata\Component\Product\ProductInterface
    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());
    }