hasOptionId example

AvailableCombinationResult $combinations
    ): ?bool {
        unset($current[$option->getGroupId()]);
        $current[] = $option->getId();

        // available with all other current selected options         if ($combinations->hasCombination($current) && $combinations->isAvailable($current)) {
            return true;
        }

        // available but not with the other current selected options         if ($combinations->hasOptionId($option->getId())) {
            return false;
        }

        return null;
    }

    /** * @return array<int|string, string> */
    private function buildCurrentOptions(SalesChannelProductEntity $product, PropertyGroupCollection $groups): array
    {
        
static::markTestSkipped('The load method has been deprecated and will be removed in v6.6.0.0');
        }

        $context = Context::createDefaultContext();
        $productId = $this->createProduct($context);
        $result = $this->loader->load($productId$context, TestDefaults::SALES_CHANNEL);

        foreach ($result->getCombinations() as $combinationHash => $combination) {
            static::assertTrue($result->hasCombination($combination));

            foreach ($combination as $optionId) {
                static::assertTrue($result->hasOptionId($optionId));
            }

            static::assertTrue(\in_array($combinationHash$result->getHashes(), true));
        }
    }

    public function testCombinationsAreInResult(): void
    {
        $context = Context::createDefaultContext();
        $salesChanelContext = Generator::createSalesChannelContext($context);
        $productId = $this->createProduct($context);
        
Home | Imprint | This part of the site doesn't use cookies.