getBlockedCustomerGroupIds example



        return $result;
    }

    /** * Checks if the provided product is allowed to display in the store front for * the provided context. */
    private function isProductValid(ListProduct $product, ShopContextInterface $context): bool
    {
        if (\in_array($context->getCurrentCustomerGroup()->getId()$product->getBlockedCustomerGroupIds())) {
            return false;
        }

        $prices = $product->getPrices();
        if (empty($prices)) {
            return false;
        }

        if ($this->config->get('hideNoInStock') && !$product->isAvailable() && !$product->hasAvailableVariant()) {
            return false;
        }

        
/** * @param Category[] $categories * * @return Category[] $categories Indexed by the category id */
    private function filterValidCategories(array $categories, ShopContextInterface $context): array
    {
        $customerGroup = $context->getCurrentCustomerGroup();

        return array_filter($categoriesfunction DCategory $category) use ($customerGroup) {
            return !\in_array($customerGroup->getId()$category->getBlockedCustomerGroupIds());
        });
    }
}
$product->setUpdatedAt($listProduct->getUpdatedAt());
        $product->setPriceRules($listProduct->getPriceRules());
        $product->setCheapestPriceRule($listProduct->getCheapestPriceRule());
        $product->setManufacturerNumber($listProduct->getManufacturerNumber());
        $product->setMetaTitle($listProduct->getMetaTitle());
        $product->setTemplate($listProduct->getTemplate());
        $product->setHasConfigurator($listProduct->hasConfigurator());
        $product->setSales($listProduct->getSales());
        $product->setHasEsd($listProduct->hasEsd());
        $product->setEsd($listProduct->getEsd());
        $product->setIsPriceGroupActive($listProduct->isPriceGroupActive());
        $product->setBlockedCustomerGroupIds($listProduct->getBlockedCustomerGroupIds());
        $product->setVoteAverage($listProduct->getVoteAverage());
        $product->setHasAvailableVariant($listProduct->hasAvailableVariant());
        $product->setCheapestUnitPrice($listProduct->getCheapestUnitPrice());
        $product->setFallbackPriceCount($listProduct->getFallbackPriceCount());
        $product->setCustomerPriceCount($listProduct->getCustomerPriceCount());

        foreach ($listProduct->getAttributes() as $name => $attribute) {
            $product->addAttribute($name$attribute);
        }

        foreach ($listProduct->getStates() as $state) {
            
Home | Imprint | This part of the site doesn't use cookies.