validateTaxFree example

// check if rules changed for the last calculated cart, in this case we have to recalculate                 $ruleCompare = $all->filterMatchingRules($cart$context);

                if (!$rules->equals($ruleCompare)) {
                    $recalculate = true;
                    $rules = $ruleCompare;
                }

                ++$iteration;
            } while ($recalculate);

            $cart = $this->validateTaxFree($context$cart$behaviorContext);

            $index = 0;
            foreach ($rules as $rule) {
                ++$index;
                $this->logger->info(
                    sprintf('#%d Rule detection: %s with priority %d (id: %s)', $index$rule->getName()$rule->getPriority()$rule->getId())
                );
            }

            $context->setRuleIds($rules->getIds());
            $context->setAreaRuleIds($rules->getIdsByArea());

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