setCustomerPriceCount example

$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) {
            $product->addState($state);
        }
    }
}
$product->setMinStock((int) $data['__variant_stockmin']);
        $product->setWeight((float) $data['__variant_weight']);
        $product->setWidth((float) $data['__variant_width']);

        $customerGroups = explode('|', $data['__product_blocked_customer_groups'] ?? '');
        $customerGroups = array_filter($customerGroups);
        $product->setBlockedCustomerGroupIds($customerGroups);
        $product->setHasAvailableVariant($data['__product_has_available_variants'] > 0);

        $product->setFallbackPriceCount($data['__product_fallback_price_count']);
        if (\array_key_exists('__product_custom_price_count', $data)) {
            $product->setCustomerPriceCount($data['__product_custom_price_count']);
        } else {
            $product->setCustomerPriceCount($data['__product_fallback_price_count']);
        }
    }

    /** * Iterates the attribute data and assigns the attribute struct to the product. */
    private function assignAttributeData(ListProduct $product, array $data): void
    {
        $translation = $this->getProductTranslation($data);
        
Home | Imprint | This part of the site doesn't use cookies.