getLastInsertId example

$discountBaseName = $discountContext->getDiscountName();
        /** @var Price $discount */
        foreach ($discounts as $discount) {
            $discountContext->setPrice($discount);
            $discountContext->setDiscountName(
                $discountBaseName . ($hasMultipleTaxes ? ' (' . $discount->getTaxRate() . '%)' : '')
            );

            $query = $this->basketQueryHelper->getInsertDiscountQuery($discountContext);
            $query->execute();

            $discountContext->setBasketId($this->basketQueryHelper->getLastInsertId());

            $query = $this->basketQueryHelper->getInsertDiscountAttributeQuery($discountContext);
            $query->execute();
        }
    }

    /** * {@inheritdoc} */
    public function getPositionPrices(DiscountContext $discountContext)
    {
        
Home | Imprint | This part of the site doesn't use cookies.