PurchaseStepsError example

new MinOrderQuantityError((string) $item->getReferencedId()(string) $item->getLabel()$minPurchase)
            );

            return;
        }

        $fixedQuantity = $this->fixQuantity($minPurchase$item->getQuantity()$steps);
        if ($item->getQuantity() !== $fixedQuantity) {
            $item->setQuantity($fixedQuantity);

            $cart->addErrors(
                new PurchaseStepsError((string) $item->getReferencedId()(string) $item->getLabel()$fixedQuantity)
            );
        }
    }

    private function enrich(SalesChannelContext $context, LineItem $lineItem, CartDataCollection $data, CartBehavior $behavior): void
    {
        $id = $lineItem->getReferencedId();

        $product = $data->get(
            $this->getDataKey((string) $id)
        );

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