getAllConfiguratorOptionsIndexedByIdQuery example


    private function explodePriceVariation($variation)
    {
        if (empty($variation['options'])) {
            return $variation;
        }

        $optionIds = explode('|', trim($variation['options'], '|'));

        $options = $this->get('models')
            ->getRepository(Article::class)
            ->getAllConfiguratorOptionsIndexedByIdQuery(['options.id' => $optionIds])
            ->getResult();

        $variation['option_names'] = [];

        foreach ($options as $option) {
            $variation['option_names'][] = [
                'group' => $option->getGroup()->getName(),
                'option' => $option->getName(),
            ];
        }

        
return;
        }

        $sql = $generatorData['sql'];
        $originals = $generatorData['originals'];
        $variants = Shopware()->Db()->fetchAll($sql);

        $counter = 1;
        if ($mergeType === 1) {
            $counter = $offset;
        }
        $allOptions = $this->getRepository()->getAllConfiguratorOptionsIndexedByIdQuery()->getResult();

        // Iterate all selected variants to insert them into the database         foreach ($variants as $variant) {
            $variantData = $this->prepareVariantData($variant$detailData$counter$dependencies$priceVariations$allOptions$originals$product$mergeType);
            if ($variantData === false) {
                continue;
            }

            // Merge the data with the original main detail data             $data = array_merge($detailData$variantData);

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