setOptionIds example

$slot = new CmsSlotEntity();
        $slot->setUniqueIdentifier('id');
        $slot->setType('buy-box');
        $slot->setFieldConfig($fieldConfig);

        $variantProduct = new SalesChannelProductEntity();
        $variantProduct->setId($investigatedProductId);
        if (isset($variantIds[0])) {
            $variantProduct->setParentId($productId);
        }
        $variantProduct->setOptionIds([Uuid::randomHex()]);

        $resolverContext = new EntityResolverContext(
            $salesChannelContext,
            new Request(),
            $this->createMock(SalesChannelProductDefinition::class),
            $variantProduct
        );

        $result = new ElementDataCollection();

        $buyBoxResolver = $this->getContainer()->get(BuyBoxCmsElementResolver::class);
        
Home | Imprint | This part of the site doesn't use cookies.