getTaxRateByConditions example


    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']) {
            

    private function getTaxesForUpdateProduct($quantity, array $queryNewPrice, array $queryAdditionalInfo)
    {
        // Determinate tax rate for this cart position         $taxRate = (float) $this->moduleManager->Articles()->getTaxRateByConditions($queryNewPrice['taxID']);

        $netPrice = $queryNewPrice['price'];

        // Recalculate price if purchase unit is set         $grossPrice = $this->moduleManager->Articles()->sCalculatingPriceNum(
            $netPrice,
            $queryNewPrice['tax'],
            false,
            false,
            $queryNewPrice['taxID'],
            false,
            

    public function getMaxTaxRate()
    {
        $maxTax = 0;

        foreach ($this->_positions as $position) {
            if ((int) $position['modus'] === CartPositionsMode::PRODUCT) {
                $getTax = $position['tax_rate'];
                if (empty($getTax) && $this->_shipping !== null) {
                    $position['tax'] = $this->getTaxRepository()->getTaxRateByConditions(
                        $position['taxID'],
                        $this->_shipping['country']['areaID'],
                        $this->_shipping['countryID'],
                        $this->_shipping['stateID'],
                        $this->_user['customergroupID']
                    );
                }
                if ($getTax > $maxTax) {
                    $maxTax = $getTax;
                }
            }
        }
Home | Imprint | This part of the site doesn't use cookies.