use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\OrFilter;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Grouping\FieldGrouping;
use Shopware\Core\Framework\Log\Package;
#[Package('inventory')]
abstract class AbstractProductDetailCmsElementResolver extends AbstractCmsElementResolver
{ abstract public function getType(): string;
public function collect(CmsSlotEntity
$slot, ResolverContext
$resolverContext): ?CriteriaCollection
{ $config =
$slot->
getFieldConfig();
if ($resolverContext instanceof EntityResolverContext &&
$resolverContext->
getDefinition() instanceof SalesChannelProductDefinition
) { $productConfig =
new FieldConfig('product', FieldConfig::SOURCE_MAPPED,
$resolverContext->
getEntity()->
get('id'
));
$config->
add($productConfig);
} $productConfig =
$config->
get('product'
);
if ($productConfig === null ||
$productConfig->
isMapped() ||
$productConfig->
getValue() === null
) { return null;
}