src/ShopBundle/objects/db/TShopUnitOfMeasurement.class.php
public function GetBasePrice($sourcePrice, $sourceQuantity)
    {
        if (empty($this->fieldFactor)) {
            $factor = 1;
        } else {
            $factor = $this->fieldFactor;
        }
        // 4€ = 500ml; 4€ = 500(0,001)L; 4/(500*0,001)€ = 1L; 4/0,5€=1L; 8€ = 1L
        $conversionFactor = $sourceQuantity * $factor;
        if ($conversionFactor < 0.000001 && $conversionFactor > -0.000001) {
            $basePrice = $sourcePrice;
        } else {
            $basePrice = $sourcePrice / $conversionFactor;
        }

        return $basePrice;
    }
public function GetBasePrice($sourcePrice, $sourceQuantity)
    {
        if (empty($this->fieldFactor)) {
            $factor = 1;
        } else {
            $factor = $this->fieldFactor;
        }
        // 4€ = 500ml; 4€ = 500(0,001)L; 4/(500*0,001)€ = 1L; 4/0,5€=1L; 8€ = 1L
        $conversionFactor = $sourceQuantity * $factor;
        if ($conversionFactor < 0.000001 && $conversionFactor > -0.000001) {
            $basePrice = $sourcePrice;
        } else {
            $basePrice = $sourcePrice / $conversionFactor;
        }

        return $basePrice;
    }
public function GetBasePrice ( $ sourcePrice , $ sourceQuantity ) { if ( empty ( $ this -> fieldFactor ) ) { $ factor = 1 ; } else { $ factor = $ this -> fieldFactor ; } // 4€ = 500ml; 4€ = 500(0,001)L; 4/(500*0,001)€ = 1L; 4/0,5€=1L; 8€ = 1L $ conversionFactor = $ sourceQuantity * $ factor ; if ( $ conversionFactor < 0.000001 && $ conversionFactor > - 0.000001 ) { $ basePrice = $ sourcePrice ; } else { $ basePrice = $ sourcePrice / $ conversionFactor ; } return $ basePrice ; }
Returns the base price for the source price.

@param float $sourcePrice
@param float $sourceQuantity

@return float
Returns the base price for the source price .