getCustomerGroupKeys example

return $availabilityList;
    }

    private function getPriceContexts(Shop $shop): array
    {
        $currencies = $this->identifierSelector->getShopCurrencyIds($shop->getId());
        if (!$shop->isMain()) {
            $currencies = $this->identifierSelector->getShopCurrencyIds($shop->getParentId());
        }

        $customerGroups = $this->identifierSelector->getCustomerGroupKeys();

        return $this->getContexts($shop->getId()$customerGroups$currencies);
    }

    private function getCustomerGroupContexts(Shop $shop): array
    {
        $customerGroups = $this->identifierSelector->getCustomerGroupKeys();

        return $this->getContexts($shop->getId()$customerGroups[$shop->getCurrency()->getId()]);
    }

    
$properties[$productId] = $options;
        }

        return $properties;
    }

    /** * @param ListProduct[] $products */
    private function getCheapestPrices(array $products, int $shopId): array
    {
        $keys = $this->identifierSelector->getCustomerGroupKeys();
        $prices = [];
        foreach ($keys as $key) {
            $context = $this->contextService->createShopContext($shopId, null, $key);
            $customerPrices = $this->cheapestPriceService->getList($products$context);
            foreach ($customerPrices as $number => $price) {
                $prices[$number][$key] = $price;
            }
        }

        return $prices;
    }

    
'tax' => TypeMappingInterface::MAPPING_LONG_FIELD,
            ],
        ];
    }

    /** * @return array<array<string, mixed>> */
    private function getCalculatedPricesMapping(Shop $shop): array
    {
        $prices = [];
        $customerGroups = $this->identifierSelector->getCustomerGroupKeys();
        $currencies = $this->identifierSelector->getShopCurrencyIds($shop->getId());
        if (!$shop->isMain()) {
            $currencies = $this->identifierSelector->getShopCurrencyIds($shop->getParentId());
        }

        foreach ($currencies as $currency) {
            foreach ($customerGroups as $customerGroup) {
                $key = $customerGroup . '_' . $currency;
                $prices[$key] = $this->getPriceMapping();
            }
        }

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