buildTaxCase example


    public function getSelection(ShopContextInterface $context)
    {
        $current = $context->getCurrentCustomerGroup();
        $currency = $context->getCurrency();

        $discount = $current->useDiscount() ? $current->getPercentageDiscount() : 0;

        $considerMinPurchase = $this->config->get('calculateCheapestPriceWithMinPurchase');

        $taxCase = $this->buildTaxCase($context);

        // Rounded to filter this value correctly         // => 2,99999999 displayed as 3,- € but won't be displayed with a filter on price >= 3,- €         $selection = 'ROUND(' .

            // Customer group price (with fallback switch)             'prices.price' .

            // Multiplied with the variant min purchase             ($considerMinPurchase ? ' * availableVariant.minpurchase' : '') .

            
$currency = $context->getCurrency();

        $priceField = 'defaultPrice.price';
        if ($fallback->getId() != $current->getId()) {
            $priceField = 'IFNULL(customerPrice.price, defaultPrice.price)';
        }

        $discount = $current->useDiscount() ? $current->getPercentageDiscount() : 0;

        $considerMinPurchase = $this->config->get('calculateCheapestPriceWithMinPurchase');

        $taxCase = $this->buildTaxCase($context);

        // rounded to filter this value correctly         // => 2,99999999 displayed as 3,- € but won't be displayed with a filter on price >= 3,- €         return 'ROUND(' .

            // customer group price (with fallback switch)             $priceField .

            // multiplied with the variant min purchase             ($considerMinPurchase ? ' * availableVariant.minpurchase' : '') .

            
Home | Imprint | This part of the site doesn't use cookies.