@param TdbShopVariantSet|null $variantSet

@return string
978614
protected function renderPrimaryArticleField(TdbShopVariantSet $variantSet = null)
    {
        $viewRenderer = $this->getViewRenderer();

        $hasVariantSet = (null !== $variantSet);
        $viewRenderer->AddSourceObject('hasVariantSet', $hasVariantSet);
        $viewRenderer->AddSourceObject('fieldName', $this->name);
        $viewRenderer->AddSourceObject('ajaxUrl', $this->GenerateAjaxURL());
        $viewRenderer->AddSourceObject('maxPossibleVariantCombinations', $this->maxPossibleVariantCombinations);

        if (true === $hasVariantSet) {
            $variantTypes = $variantSet->GetFieldShopVariantTypeList();
            $variantTypeParameters = array();
            while ($variantType = $variantTypes->Next()) {
                $variantValueList = $variantType->GetFieldShopVariantTypeValueList();

                $typeVariants = array();
                while ($variantValue = $variantValueList->Next()) {
                    $typeVariants[$variantValue->id] = $variantValue->GetName();
                }

                asort($typeVariants);
                $variantTypeParameters[$variantType->GetName()] = array('variantTypeName' => $variantType->GetName(), 'variantTypeId' => $variantType->id, 'typeVariants' => $typeVariants);
                ksort($variantTypeParameters);
            }

            $viewRenderer->AddSourceObject('variantTypeParameters', $variantTypeParameters);
        }

        return $viewRenderer->Render('ChameleonSystemShopBundle:snippets-cms/TCMSFieldShopVariantDetails:main-product.html.twig');
    }
133015
public function toQuery( $variableSet, $factVariableBinding )
	{
		$variable = $this->variable['originalPrefix']
			? "{$this->variable['originalPrefix']}:{$this->variable['name']}"
			: $this->variable['name'];
		$aspects = implode("','", $this->getAspectsCovered( $variableSet, $factVariableBinding ) );
		$class = get_class($this);
		return "(lyquidity:aspectMatch(\$lyquidity:factVariable,\$lyquidity:variableSet,.,\$$variable,('$aspects'),'$class'))";
	}
29404
public Map<String, String> getAvailableVariantMap(Map<String, VariantSet> variants,
			Map<String, String> curVariants) {

		Map<String, String> availableVariantMap = new HashMap<>();
		for (Entry<String, VariantSet> entry : variants.entrySet()) {
			String variantType = entry.getKey();
			VariantSet variantSet = entry.getValue();
			String variant = variantSet.getDefaultVariant();
			if (curVariants.containsKey(variantType)) {
				String curVariant = curVariants.get(variantType);
				VariantResolver resolver = variantResolvers.get(variantType);
				if (resolver != null) {
					variant = resolver.getAvailableVariant(curVariant, variants.get(variantType));
					if (variant == null) {
						variant = variants.get(variantType).getDefaultVariant();
					}
				} else {
					throw new BundlingProcessException(
							"Unable to find variant resolver for variant type '" + variantType + "'");
				}
			}
			availableVariantMap.put(variantType, variant);
		}
		return availableVariantMap;
	}
754300
public function getSetString($usePlaceholders = true, $includeText = true)
    {
        $statement = "";
        $this->setPlaceholderValues = array();

        foreach ($this->set as $set) {
            $autoQuote = $this->getAutoQuote($set['quote']);

            if ($usePlaceholders && $autoQuote) {
                if (strpos($set['column'], '.') !== false) {
                    $colum = explode(".", $set['column']);
                    foreach ($colum as $key => $value) {
                        $colum[$key] = "`$value`";
                    }
                    $statement .= implode(".", $colum) . " " . self::EQUALS . " ?, ";
                } else {
                    $statement .= "`" . $set['column'] . "` " . self::EQUALS . " ?, ";
                }

                if ($set['value'] === false) {
                    $this->setPlaceholderValues[] = 0;
                } elseif ($set['value'] === true) {
                    $this->setPlaceholderValues[] = 1;
                } else {
                    $this->setPlaceholderValues[] = $set['value'];
                }
            } else {
                if (strpos($set['column'], '.') !== false) {
                    $colum = explode(".", $set['column']);
                    foreach ($colum as $key => $value) {
                        $colum[$key] = "`$value`";
                    }
                    $statement .= implode(".", $colum) . " " . self::EQUALS . " " . $this->autoQuote($set['value'], $autoQuote) . ", ";
                } else {
                    $statement .= "`" . $set['column'] . "` " . self::EQUALS . " " . $this->autoQuote($set['value'], $autoQuote) . ", ";
                }
            }
        }

        $statement = substr($statement, 0, -2);

        if ($includeText && $statement) {
            $statement = "SET " . $statement;
        }
        return $statement;
    }
273540
public static List<Map<String, String>> getAllVariants(Map<String, ? extends Collection<String>> variantSets) {

		List<Map<String, String>> variants = new ArrayList<>();
		if (variantSets != null) {
			for (Entry<String, Collection<String>> variantEntry : new TreeMap<>(variantSets).entrySet()) {
				String variantType = variantEntry.getKey();
				Collection<String> variantList = variantEntry.getValue();
				if (variants.isEmpty()) {
					variants = getVariants(null, variantType, variantList);
				} else {

					List<Map<String, String>> tmpResult = new ArrayList<>();
					for (Map<String, String> curVariant : variants) {
						tmpResult.addAll(getVariants(curVariant, variantType, variantList));
					}
					variants = tmpResult;
				}
			}
		}

		return variants;
	}
1208621
public static function getDimensionsForFact( $variableSet, $fact )
	{
		$contextRef = FactValues::getContextRef( $fact );
		return FactValues::getDimensionsInContextRef( $variableSet, $contextRef );
	}
414317
private static String serializeVariantSets(Map<String, VariantSet> map) {
		StringBuilder result = new StringBuilder();

		for (Entry<String, VariantSet> entry : map.entrySet()) {
			result.append(entry.getKey()).append(":");
			VariantSet variantSet = (VariantSet) entry.getValue();
			result.append(variantSet.getDefaultVariant()).append(":");
			result.append(getCommaSeparatedString(variantSet));
			result.append(";");
		}

		return result.toString();
	}
967373
public function GetVariantsForVariantTypeName($sVariantTypeIdentifier)
    {
        $oArticleList = &$this->GetFromInternalCache('VariantsForVariantTypeName'.$sVariantTypeIdentifier);
        if (is_null($oArticleList)) {
            $oArticleList = null;
            $oVariantSet = &$this->GetFieldShopVariantSet();
            if (!is_null($oVariantSet)) {
                $oVariantType = $oVariantSet->GetVariantTypeForIdentifier($sVariantTypeIdentifier);
                if (!is_null($oVariantType)) {
                    $sQueryAddition = '';
                    if ($this->IsVariant()) {
                        $sCommmonParentId = $this->fieldVariantParentId;
                        // make sure the current article is part of the list
                        $sActingValueForTypeId = $this->GetVariantTypeActiveValue($oVariantType->id);
                        $sQueryAddition .= "AND ((`shop_article`.`id` = '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."' AND `shop_variant_type_value`.`id` = '".MySqlLegacySupport::getInstance()->real_escape_string($sActingValueForTypeId)."') OR (`shop_article`.`id` != '".MySqlLegacySupport::getInstance()->real_escape_string($this->id)."' AND `shop_variant_type_value`.`id` != '".MySqlLegacySupport::getInstance()->real_escape_string($sActingValueForTypeId)."'))";
                    } else {
                        $sCommmonParentId = $this->id;
                    }
                    $sActiveArticleRestriction = TdbShopArticleList::GetActiveArticleQueryRestriction(false);
                    if (!empty($sActiveArticleRestriction)) {
                        $sQueryAddition = $sQueryAddition.' AND ('.$sActiveArticleRestriction.')';
                    }

                    $query = "SELECT `shop_article`.*
                        FROM `shop_article`
                  INNER JOIN `shop_article_shop_variant_type_value_mlt` ON `shop_article`.`id` = `shop_article_shop_variant_type_value_mlt`.`source_id`
                  INNER JOIN `shop_variant_type_value` ON `shop_article_shop_variant_type_value_mlt`.`target_id` = `shop_variant_type_value`.`id`
                       WHERE `shop_article`.`variant_parent_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($sCommmonParentId)."'
                         AND `shop_variant_type_value`.`shop_variant_type_id` = '".MySqlLegacySupport::getInstance()->real_escape_string($oVariantType->id)."'
                         {$sQueryAddition}
                    GROUP BY `shop_variant_type_value`.`id`
                     ";
                    if (!empty($oVariantType->fieldShopVariantTypeValueCmsfieldname)) {
                        $query .= 'ORDER BY `shop_variant_type_value`.`'.MySqlLegacySupport::getInstance()->real_escape_string($oVariantType->fieldShopVariantTypeValueCmsfieldname).'`';
                    }
                    //            print_r($query);exit();
                    $oArticleList = TdbShopArticleList::GetList($query);
                    $oArticleList->bAllowItemCache = true;
                    $this->SetInternalCache('VariantsForVariantTypeName'.$sVariantTypeIdentifier, $oArticleList);
                }
            }
        }

        return $oArticleList;
    }
606065
public function getProductVariantsByIds($ids)
	{
		$this->ids($ids);
		$params = $this->getQueryParams();

		$uriAppend = 'detail/variants';
		$response = $this->handler->handle('GET', false, $uriAppend, $params);

		return $this->make($response);
	}
591272
@Override
	public String getAvailableVariant(String variant, VariantSet variantSet) {
		String availableVariant = null;
		if (variantSet.contains(variant)) {
			availableVariant = variant;
		} else {
			String subVar = variant;
			while (subVar.indexOf('_') != -1) {
				subVar = subVar.substring(0, subVar.lastIndexOf('_'));
				if (variantSet.contains(subVar)) {
					availableVariant = subVar;
				}
			}
		}
		if (availableVariant == null) {
			availableVariant = variantSet.getDefaultVariant();
		}

		return availableVariant;
	}
1102576
def removeVariantSet(self, variantSet):
        
        for variantSetRecord in models.Variantset.select().where(
                        models.Variantset.id == variantSet.getId()):
            variantSetRecord.delete_instance(recursive=True)
1308738
public static function GetRegisteredActiveVariantForCurrentSpot($sParentId)
    {
        $sShopVariantArticleId = false;
        if (array_key_exists(TdbShop::SESSION_ACTIVE_VARIANT_ARRAY, $_SESSION)) {
            $oGlobal = TGlobal::instance();
            $oExecutingModuleSpot = $oGlobal->GetExecutingModulePointer();
            if ($oExecutingModuleSpot) {
                $sSpotName = $oExecutingModuleSpot->sModuleSpotName;
                if (array_key_exists($sSpotName, $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY]) && array_key_exists($sParentId, $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY][$sSpotName])) {
                    $sShopVariantArticleId = $_SESSION[TdbShop::SESSION_ACTIVE_VARIANT_ARRAY][$sSpotName][$sParentId];
                }
            }
        }

        return $sShopVariantArticleId;
    }
826585
public function toQuery( $variableSet, $factVariableBinding )
	{
		$clauses = array();

		// Include the qnames if being called as part of a boolean filter or there are qname expressions
		if ( $this->inBoolean || $this->qnameExpressions )
		foreach ( $this->qnames as $clark )
		{
			$qname = qname( $clark );
			$clauses[] = "(fn:node-name(.) eq fn:QName('{$qname->namespaceURI}','{$qname->localName}'))";
		}

		foreach ( $this->qnameExpressions as $qnameExpression )
		{
			$clauses[] = "(fn:node-name(.) eq $qnameExpression)";
		}

		if ( ! $clauses )
		{
			return null;
		}

		$query = implode( " or ", $clauses );
		return count( $clauses ) > 1 ? "($query)" : $query;
	}
950959
@Override
	public List<BundlePath> getItemDebugPathList(Map<String, String> variants) {

		if (StringUtils.isNotEmpty(debugURL)) {
			return bundlePathMapping.getItemDebugPathList();
		}
		return getItemPathList(bundlePathMapping.getItemDebugPathList(), variants);
	}
275926
public function getPicturesProduct()
    {
        $variantSelections = $this->getVariantSelections();
        if ($variantSelections && $variantSelections['oActiveVariant'] && !$variantSelections['blPerfectFit']) {
            return $variantSelections['oActiveVariant'];
        }

        return $this->getProduct();
    }
73445
public function getPlural($amount, array $variants, $absence = null)
    {
        if ($amount || $absence === null) {
            $result = RUtils::formatNumber($amount).' '.$this->choosePlural($amount, $variants);
        } else {
            $result = $absence;
        }
        return $result;
    }
390454
def removeVariantSet(self):
        
        self._openRepo()
        dataset = self._repo.getDatasetByName(self._args.datasetName)
        variantSet = dataset.getVariantSetByName(self._args.variantSetName)

        def func():
            self._updateRepo(self._repo.removeVariantSet, variantSet)
        self._confirmDelete("VariantSet", variantSet.getLocalId(), func)