Pricing/ItemPriceCalculator.php
public function calculateItemTotalNetPrice($item, $currency = null, $useProductsPrice = true, $isGrossPrice = false)
    {
        $priceValue = $this->calculateItemNetPrice($item, $currency, $useProductsPrice, $isGrossPrice);

        if ($priceValue === null) {
            $priceValue = 0;
        }

        if ($item->getPrice() && $item->getPrice() !== $priceValue) {
            $item->setPriceChange($item->getPrice(), $priceValue);
        }

        $itemPrice = $priceValue * $item->getCalcQuantity();

        // Calculate items discount.
        $discount = ($itemPrice / 100) * $item->getCalcDiscount();

        // Calculate total item price.
        $totalPrice = $itemPrice - $discount;

        return $totalPrice;
    }
public function calculateItemTotalNetPrice($item, $currency = null, $useProductsPrice = true, $isGrossPrice = false)
    {
        $priceValue = $this->calculateItemNetPrice($item, $currency, $useProductsPrice, $isGrossPrice);

        if ($priceValue === null) {
            $priceValue = 0;
        }

        if ($item->getPrice() && $item->getPrice() !== $priceValue) {
            $item->setPriceChange($item->getPrice(), $priceValue);
        }

        $itemPrice = $priceValue * $item->getCalcQuantity();

        // Calculate items discount.
        $discount = ($itemPrice / 100) * $item->getCalcDiscount();

        // Calculate total item price.
        $totalPrice = $itemPrice - $discount;

        return $totalPrice;
    }
public function calculateItemTotalNetPrice ( $ item , $ currency = null , $ useProductsPrice = true , $ isGrossPrice = false ) { $ priceValue = $ this -> calculateItemNetPrice ( $ item , $ currency , $ useProductsPrice , $ isGrossPrice ) ; if ( $ priceValue === null ) { $ priceValue = 0 ; } if ( $ item -> getPrice ( ) && $ item -> getPrice ( ) !== $ priceValue ) { $ item -> setPriceChange ( $ item -> getPrice ( ) , $ priceValue ) ; } $ itemPrice = $ priceValue * $ item -> getCalcQuantity ( ) ; // Calculate items discount. $ discount = ( $ itemPrice / 100 ) * $ item -> getCalcDiscount ( ) ; // Calculate total item price. $ totalPrice = $ itemPrice - $ discount ; return $ totalPrice ; }
Calculates the overall total price of an item.

@param CalculableBulkPriceItemInterface $item
@param string|null $currency
@param bool|null $useProductsPrice
@param bool|null $isGrossPrice

@return float
Calculates the overall total price of an item .