generateCriteria example

$collection->getBatchRequest()->setProductNumbers($key[$element->getConfig()->get('article')]);

            return;
        }

        if ($type === self::TYPE_STATIC_VARIANT) {
            $collection->getBatchRequest()->setProductNumbers($key[$element->getConfig()->get('variant')]);

            return;
        }

        $criteria = $this->generateCriteria($element$context);

        // request multiple products by criteria         $collection->getBatchRequest()->setCriteria($key$criteria);
    }

    /** * {@inheritdoc} */
    public function handle(ResolvedDataCollection $collection, Element $element, ShopContextInterface $context)
    {
        $key = ComponentHandlerInterface::CRITERIA_KEY . $element->getId();
        
/** * {@inheritdoc} */
    public function prepare(PrepareDataCollection $collection, Element $element, ShopContextInterface $context)
    {
        $type = $element->getConfig()->get(self::SLIDER_TYPE_KEY, self::TYPE_STATIC_PRODUCT);
        $key = ComponentHandlerInterface::CRITERIA_KEY . $element->getId();

        switch ($type) {
            case self::TYPE_PRODUCT_STREAM:
                $criteria = $this->generateCriteria($element$context);

                $productStreamId = $element->getConfig()->get('article_slider_stream');
                $this->productStreamRepository->prepareCriteria($criteria$productStreamId);

                // request multiple products by criteria                 $collection->getBatchRequest()->setCriteria($key$criteria);
                break;

            case self::TYPE_TOPSELLER:
            case self::TYPE_NEWCOMER:
            case self::TYPE_RANDOM:
            
Home | Imprint | This part of the site doesn't use cookies.