96 $this->_sParentId = $sParentId;
118 $this->_aSubvariants = $aSubvariants;
139 if (count($aMdSubvariants))
140 return reset($aMdSubvariants);
155 foreach ($aSubvariants as $oMdSubvariant) {
156 if (strcasecmp($oMdSubvariant->getName(), $sName) == 0)
157 return $oMdSubvariant;
160 $oNewSubvariant =
oxNew(
"oxMdVariant");
161 $oNewSubvariant->setName($sName);
162 $oNewSubvariant->setId(md5($sName.$this->getId()));
163 $oNewSubvariant->setParentId($this->
getId());
166 return $oNewSubvariant;
177 if ($oFirstSubvariant)
178 return $oFirstSubvariant->getLink();
192 $this->_sName = $sName;
224 foreach ($aVariants as $oVariant) {
225 $dMinVariantPrice = $oVariant->getMinDPrice();
226 if (is_null($dMinPrice)) {
227 $dMinPrice = $dMinVariantPrice;
229 if (!is_null($dMinVariantPrice) && $dMinVariantPrice < $dMinPrice) {
230 $dMinPrice = $dMinVariantPrice;
246 if (!count($aSubvariants))
250 foreach ($aSubvariants as $oSubvariant) {
251 if ($oSubvariant->getMaxDepth() > $iMaxDepth) {
252 $iMaxDepth = $oSubvariant->getMaxDepth();
256 return $iMaxDepth + 1;
268 if ( !
$myConfig->getConfigParam(
'bl_perfLoadPrice' ) ) {
283 $sCurrency =
' '.$this->getConfig()->getActShopCurrencyObject()->sign;
284 $this->_sFPrice = $sFromPrefix . $sFMinPrice . $sCurrency;
299 public function addNames($sArtId, $aNames, $dPrice, $sUrl)
301 $iCount = count($aNames);
302 $sName = array_shift($aNames);
308 $oVariant->addNames($sArtId, $aNames, $dPrice, $sUrl);
311 $this->_sArticleId = $sArtId;
312 $this->_dPrice = $dPrice;
313 $this->_sUrl = $sUrl;
326 if ($oFirstSubvariant)
327 return $oFirstSubvariant->getArticleId();
345 foreach ($aSubvariants as $oSubvariant) {
346 if ($oSubvariant->hasArticleId($sArtId))
362 $this->_aSubvariants[$oSubvariant->getId()] = $oSubvariant;
374 foreach ($aVariants as $oVariant) {
375 $dVariantPrice = $oVariant->getDPrice();
376 if (is_null($dPrice)) {
377 $dPrice = $dVariantPrice;
379 if (!is_null($dVariantPrice) && $dVariantPrice != $dPrice) {
382 if (!$oVariant->_isFixedPrice()) {