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

        if ($useProductsPrice === null) {
            $useProductsPrice = $item->getUseProductsPrice();
        }

        // Validate item
        $this->validateItem($item);

        $priceValue = $item->getPrice();

        if ($useProductsPrice && ($item->getCalcProduct() || $item->getAddon())) {
            $priceValue = $this->getValidProductNetPriceForItem($item, $currency);
        } elseif ($isGrossPrice) {
            // Handle gross prices.
            $tax = $item->getTax();
            if ($tax > 0) {
                $priceValue = ($priceValue / (100 + $tax)) * 100;
            }
        }

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

        if ($useProductsPrice === null) {
            $useProductsPrice = $item->getUseProductsPrice();
        }

        // Validate item
        $this->validateItem($item);

        $priceValue = $item->getPrice();

        if ($useProductsPrice && ($item->getCalcProduct() || $item->getAddon())) {
            $priceValue = $this->getValidProductNetPriceForItem($item, $currency);
        } elseif ($isGrossPrice) {
            // Handle gross prices.
            $tax = $item->getTax();
            if ($tax > 0) {
                $priceValue = ($priceValue / (100 + $tax)) * 100;
            }
        }

        return $priceValue;
    }
public function calculateItemNetPrice ( $ item , $ currency = null , $ useProductsPrice = null , $ isGrossPrice = false ) { $ currency = $ this -> getCurrency ( $ currency ) ; if ( $ useProductsPrice === null ) { $ useProductsPrice = $ item -> getUseProductsPrice ( ) ; } // Validate item $ this -> validateItem ( $ item ) ; $ priceValue = $ item -> getPrice ( ) ; if ( $ useProductsPrice && ( $ item -> getCalcProduct ( ) || $ item -> getAddon ( ) ) ) { $ priceValue = $ this -> getValidProductNetPriceForItem ( $ item , $ currency ) ; } elseif ( $ isGrossPrice ) { // Handle gross prices. $ tax = $ item -> getTax ( ) ; if ( $ tax > 0 ) { $ priceValue = ( $ priceValue / ( 100 + $ tax ) ) * 100 ; } } return $ priceValue ; }
Returns price of a single item based on it's quantity.

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

@throws PriceCalculationException

@return float
Returns price of a single item based on it s quantity .