public function sCalculatingPrice($price,
$tax,
$taxId = 0,
$article =
[]) { if (empty($taxId)) { throw new Enlight_Exception('Empty taxID in sCalculatingPrice'
);
} $price =
(float) $price;
// Support tax rate defined by certain conditions
$getTaxByConditions =
$this->
getTaxRateByConditions($taxId);
if ($getTaxByConditions === false
) { $tax =
(float) $tax;
} else { $tax =
(float) $getTaxByConditions;
} // Calculate global discount
if ($this->sSYSTEM->sUSERGROUPDATA
['mode'
] &&
$this->sSYSTEM->sUSERGROUPDATA
['discount'
]) { $price -= ($price / 100 *
$this->sSYSTEM->sUSERGROUPDATA
['discount'
]);
} if ($this->sSYSTEM->sCurrency
['factor'
]) {