Пример #1
0
 /**
  * Returns array containing default list type and category (or manufacturer ir vendor) id
  *
  * @param oxArticle $oProduct current product object
  *
  * @return array
  */
 protected function _getDefaultParams($oProduct)
 {
     $sListType = null;
     $aArticleCats = $oProduct->getCategoryIds(true);
     if (is_array($aArticleCats) && count($aArticleCats)) {
         $sActCat = reset($aArticleCats);
     } elseif ($sActCat = $oProduct->getManufacturerId()) {
         // not assigned to any category ? maybe it is assigned to Manufacturer ?
         $sListType = 'manufacturer';
     } elseif ($sActCat = $oProduct->getVendorId()) {
         // not assigned to any category ? maybe it is assigned to vendor ?
         $sListType = 'vendor';
     } else {
         $sActCat = null;
     }
     return array($sListType, $sActCat);
 }