buildDiscountGraduations example

if (!isset($priceGroups[$priceGroupId])) {
                continue;
            }

            $priceGroup = $priceGroups[$priceGroupId];

            $firstGraduation = array_shift($prices[$product->getNumber()]);
            if (!$firstGraduation instanceof PriceRule) {
                continue;
            }

            $prices[$product->getNumber()] = $this->buildDiscountGraduations(
                $firstGraduation,
                $context->getCurrentCustomerGroup(),
                $priceGroup->getDiscounts()
            );
        }

        return $prices;
    }

    /** * Helper function which builds the graduated prices * of a product for the passed price group discount array. * * This function is used to override the normal graduated prices * with a definition of the product price group discounts. * * @param PriceDiscount[] $discounts * * @return array<PriceRule> */
Home | Imprint | This part of the site doesn't use cookies.