Check if variant is multidimensional

@param \OxidEsales\Eshop\Application\Model\Article $oArticle Article object

@return bool
505241
public function isMdVariant($oArticle)
    {
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blUseMultidimensionVariants')) {
            if (strpos($oArticle->oxarticles__oxvarselect->value, trim($this->_sMdSeparator)) !== false) {
                return true;
            }
        }

        return false;
    }
1144494
public function hasOutOfStockArticles()
    {
        $result = false;

        $basketContents = $this->getBasket()->getContents();

        foreach ($basketContents as $basketItem) {
            $article = $basketItem->getArticle();
            if (($article->getStockAmount() - $basketItem->getAmount()) < $this->getEmptyStockLevel()) {
                $result = true;
                break;
            }
        }

        return $result;
    }
1094069
public function getArticle()
    {
        if ($this->_oArticle == null) {
            $this->_oArticle = false;
            $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
            if ($oArticle->load($this->oxpricealarm__oxartid->value)) {
                $this->_oArticle = $oArticle;
            }
        }

        return $this->_oArticle;
    }
913325
public function addArticleCross()
    {
        $aChosenArt = $this->_getActionIds('oxarticles.oxid');
        $soxId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('synchoxid');

        // adding
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('all')) {
            $sArtTable = $this->_getViewName('oxarticles');
            $aChosenArt = $this->_getAll(parent::_addFilter("select $sArtTable.oxid " . $this->_getQuery()));
        }

        $oArticle = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        if ($oArticle->load($soxId) && $soxId && $soxId != "-1" && is_array($aChosenArt)) {
            foreach ($aChosenArt as $sAdd) {
                $oNewGroup = oxNew(\OxidEsales\Eshop\Core\Model\BaseModel::class);
                $oNewGroup->init('oxobject2article');
                $oNewGroup->oxobject2article__oxobjectid = new \OxidEsales\Eshop\Core\Field($sAdd);
                $oNewGroup->oxobject2article__oxarticlenid = new \OxidEsales\Eshop\Core\Field($oArticle->oxarticles__oxid->value);
                $oNewGroup->oxobject2article__oxsort = new \OxidEsales\Eshop\Core\Field(0);
                $oNewGroup->save();
            }

            $this->onArticleAddingToCrossSelling($oArticle);
        }
    }
598055
protected function _prepareArticleTitle($oArticle)
    {
        // create title part for uri
        if (!($sTitle = $oArticle->oxarticles__oxtitle->value)) {
            // taking parent article title
            if (($sParentId = $oArticle->oxarticles__oxparentid->value)) {
                // looking in cache ..
                if (!isset(self::$_aTitleCache[$sParentId])) {
                    $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
                    $sQ = "select oxtitle from " . $oArticle->getViewName() . " where oxid = " . $oDb->quote($sParentId);
                    self::$_aTitleCache[$sParentId] = $oDb->getOne($sQ);
                }
                $sTitle = self::$_aTitleCache[$sParentId];
            }
        }

        // variant has varselect value
        if ($oArticle->oxarticles__oxvarselect->value) {
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxvarselect->value . ' ';
        } elseif (!$sTitle || ($oArticle->oxarticles__oxparentid->value)) {
            // in case nothing was found - looking for number
            $sTitle .= ($sTitle ? ' ' : '') . $oArticle->oxarticles__oxartnum->value;
        }

        return $this->_prepareTitle($sTitle, false, $oArticle->getLanguage()) . $this->_getUrlExtension();
    }
693465
public function &GetArticleObject()
    {
        if (is_null($this->oArticle)) {
            $this->oArticle = TdbShopArticle::GetNewInstance();
            if (!$this->oArticle->Load($this->sqlData['shop_article_id'])) {
                $this->oArticle = null;
            }
        }

        return $this->oArticle;
    }
143650
public function hasMetaData(ArticleMetaInterface $metaData)
    {
        $result = false;

        foreach($this->metaData as $meta)
        {
            if($meta->getKey() == $metaData->getKey() && $meta->getValue() == $metaData->getValue())
            {
                $result = true;

                break;
            }
        }

        return $result;
    }
1360310
private function is_multidimensional($array) {

		if(false === is_array($array)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type Array, "%s" given', __METHOD__, gettype($array)), E_USER_ERROR);
		}

	    return (count(array_filter($array, 'is_array')) > 0);
	}
298597
protected function _getVatForArticleCategory(\OxidEsales\Eshop\Application\Model\Article $oArticle)
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sCatT = getViewName('oxcategories');

        if ($this->_blCatVatSet === null) {
            $sSelect = "SELECT oxid FROM $sCatT WHERE oxvat IS NOT NULL LIMIT 1";

            //no category specific vats in shop?
            //then for performance reasons we just return false
            $this->_blCatVatSet = (bool) $oDb->getOne($sSelect);
        }

        if (!$this->_blCatVatSet) {
            return false;
        }

        $sO2C = getViewName('oxobject2category');
        $sSql = "SELECT c.oxvat
                 FROM $sCatT AS c, $sO2C AS o2c
                 WHERE c.oxid=o2c.oxcatnid AND
                       o2c.oxobjectid = " . $oDb->quote($oArticle->getId()) . " AND
                       c.oxvat IS NOT NULL
                 ORDER BY o2c.oxtime ";

        $fVat = $oDb->getOne($sSql);
        if ($fVat !== false && $fVat !== null) {
            return $fVat;
        }

        return false;
    }
1335930
protected function SetShippingTypeForArticle(TShopBasketArticle &$oItem, TdbShopShippingType &$oShippingType)
    {
        $iCurrentPos = $this->getItemPointer();
        $this->GoToStart();
        $bFound = false;
        while (!$bFound && ($oExistingItem = &$this->Next())) {
            /** @var $oExistingItem TShopBasketArticle */
            if ($oExistingItem->IsSameAs($oItem)) {
                $bFound = true;
            }
        }
        if ($bFound) {
            $oExistingItem->SetActingShippingType($oShippingType);
        }
        $this->setItemPointer($iCurrentPos);
    }
45746
public function getArticleVat(\OxidEsales\Eshop\Application\Model\Article $oArticle)
    {
        startProfile("_assignPriceInternal");
        // article has its own VAT ?

        if (($dArticleVat = $oArticle->getCustomVAT()) !== null) {
            stopProfile("_assignPriceInternal");

            return $dArticleVat;
        }
        if (($dArticleVat = $this->_getVatForArticleCategory($oArticle)) !== false) {
            stopProfile("_assignPriceInternal");

            return $dArticleVat;
        }

        stopProfile("_assignPriceInternal");

        return \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('dDefaultVAT');
    }
261658
protected function _getManufacturerList($oArticle)
    {
        if ($oArticle->oxarticles__oxmanufacturerid->value) {
            $oManufacturer = oxNew(\OxidEsales\Eshop\Application\Model\Manufacturer::class);
            if ($oManufacturer->loadInLang($this->getEditLang(), $oArticle->oxarticles__oxmanufacturerid->value)) {
                return [$oManufacturer];
            }
        }
    }
350902
protected function &getCategoryList(TdbShopArticle $oArticle)
    {
        /** @var $oCategoryList TdbShopCategoryList */
        $oCategoryList = &$oArticle->GetFieldShopCategoryList();
        $oCategoryList->GoToStart();
        if (0 === $oCategoryList->Length() && $oArticle->IsVariant()) {
            $oParent = &$oArticle->GetFieldVariantParent();
            $oCategoryList = &$oParent->GetFieldShopCategoryList();
            $oCategoryList->GoToStart();
        }

        return $oCategoryList;
    }
773106
public function getParentArticle()
    {
        if ($this->oxarticles__oxparentid && ($sParentId = $this->oxarticles__oxparentid->value)) {
            $sIndex = $sParentId . "_" . $this->getLanguage();
            if (!isset(self::$_aLoadedParents[$sIndex])) {
                self::$_aLoadedParents[$sIndex] = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
                self::$_aLoadedParents[$sIndex]->_blLoadPrice = false;
                self::$_aLoadedParents[$sIndex]->_blLoadVariants = false;

                if (!self::$_aLoadedParents[$sIndex]->loadInLang($this->getLanguage(), $sParentId)) {
                    //return false in case parent product failed to load
                    self::$_aLoadedParents[$sIndex] = false;
                }
            }

            return self::$_aLoadedParents[$sIndex];
        }
    }
299693
public function getArticle($blReset = false)
    {
        if ($this->_oArticle !== null && !$blReset) {
            return $this->_oArticle;
        }
        $sProductId = $this->getEditObjectId();

        $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
        $oProduct->load($sProductId);

        return $this->_oArticle = $oProduct;
    }
1125362
public function isForBasket($oBasket)
    {
        // amount for conditional check
        $blHasArticles = $this->hasArticles();
        $blHasCategories = $this->hasCategories();
        $blUse = true;
        $aggregatedDeliveryAmount = 0;
        $blForBasket = false;

        // category & article check
        if ($blHasCategories || $blHasArticles) {
            $blUse = false;

            $aDeliveryArticles = $this->getArticles();
            $aDeliveryCategories = $this->getCategories();

            foreach ($oBasket->getContents() as $oContent) {
                //V FS#1954 - load delivery for variants from parent article
                $oArticle = $oContent->getArticle(false);
                $sProductId = $oArticle->getProductId();
                $sParentId = $oArticle->getParentId();

                if ($blHasArticles && (in_array($sProductId, $aDeliveryArticles) || ($sParentId && in_array($sParentId, $aDeliveryArticles)))) {
                    $blUse = true;
                    $artAmount = $this->getDeliveryAmount($oContent);
                    if ($this->isDeliveryRuleFitByArticle($artAmount)) {
                        $blForBasket = true;
                        $this->updateItemCount($oContent);
                        $this->increaseProductCount();
                    }
                    if (!$blForBasket) {
                        $aggregatedDeliveryAmount += $artAmount;
                    }
                } elseif ($blHasCategories) {
                    if (isset(self::$_aProductList[$sProductId])) {
                        $oProduct = self::$_aProductList[$sProductId];
                    } else {
                        $oProduct = oxNew(\OxidEsales\Eshop\Application\Model\Article::class);
                        $oProduct->setSkipAssign(true);

                        if (!$oProduct->load($sProductId)) {
                            continue;
                        }

                        $oProduct->setId($sProductId);
                        self::$_aProductList[$sProductId] = $oProduct;
                    }

                    foreach ($aDeliveryCategories as $sCatId) {
                        if ($oProduct->inCategory($sCatId)) {
                            $artAmount = $this->getDeliveryAmount($oContent);

                            $blUse = true;
                            if ($this->isDeliveryRuleFitByArticle($artAmount)) {
                                $blForBasket = true;
                                $this->updateItemCount($oContent);
                                $this->increaseProductCount();
                            }
                            if (!$blForBasket) {
                                $aggregatedDeliveryAmount += $artAmount;
                            }

                            //HR#5650 product might be in multiple rule categories, counting it once is enough
                            break;
                        }
                    }
                }
            }
        } else {
            // regular amounts check
            foreach ($oBasket->getContents() as $oContent) {
                $artAmount = $this->getDeliveryAmount($oContent);
                if ($this->isDeliveryRuleFitByArticle($artAmount)) {
                    $blForBasket = true;
                    $this->updateItemCount($oContent);
                    $this->increaseProductCount();
                }
                if (!$blForBasket) {
                    $aggregatedDeliveryAmount += $artAmount;
                }
            }
        }

        //#M1130: Single article in Basket, checked as free shipping, is not buyable (step 3 no payments found)
        if (!$blForBasket && $blUse && ($this->_checkDeliveryAmount($aggregatedDeliveryAmount) || $this->_blFreeShipping)) {
            $blForBasket = true;
        }

        return $blForBasket;
    }
1125989
public function AllowDiscountForArticle(TdbShopArticle $oArticle)
    {
        $bMayBeUsed = true;
        if ($oArticle->fieldExcludeFromDiscounts) {
            $bMayBeUsed = false;
        }

        // check article restrictions
        if ($bMayBeUsed) {
            $aArticleRestrictions = $this->GetFieldShopArticleWithInverseEmptySelectionLogicIdList();
            if (null === $aArticleRestrictions || (count($aArticleRestrictions) > 0 && !in_array($oArticle->id, $aArticleRestrictions))) {
                $bMayBeUsed = false;
            }
        }

        // check category restrictions
        if ($bMayBeUsed) {
            $aCategoryRestrictions = $this->GetFieldShopCategoryWithInverseEmptySelectionLogicIdList();
            if (null === $aCategoryRestrictions || (count($aCategoryRestrictions) > 0 && !$oArticle->IsInCategory($aCategoryRestrictions))) {
                $bMayBeUsed = false;
            }
        }

        return $bMayBeUsed;
    }