enrichFromSearch example


        $config = $slot->getFieldConfig();
        $slider = new ProductSliderStruct();
        $slot->setData($slider);

        $productConfig = $config->get('products');
        if ($productConfig === null) {
            return;
        }

        if ($productConfig->isStatic()) {
            $this->enrichFromSearch($slider$result, self::STATIC_SEARCH_KEY . '_' . $slot->getUniqueIdentifier()$resolverContext->getSalesChannelContext());
        }

        if ($productConfig->isMapped() && $resolverContext instanceof EntityResolverContext) {
            $products = $this->resolveEntityValue($resolverContext->getEntity()$productConfig->getStringValue());
            if ($products === null) {
                $this->enrichFromSearch($slider$result, self::PRODUCT_SLIDER_ENTITY_FALLBACK . '_' . $slot->getUniqueIdentifier()$resolverContext->getSalesChannelContext());
            } else {
                $slider->setProducts($products);
            }
        }

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