當前位置: 首頁>>代碼示例>>PHP>>正文


PHP mslib_fe::getProducts方法代碼示例

本文整理匯總了PHP中mslib_fe::getProducts方法的典型用法代碼示例。如果您正苦於以下問題:PHP mslib_fe::getProducts方法的具體用法?PHP mslib_fe::getProducts怎麽用?PHP mslib_fe::getProducts使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mslib_fe的用法示例。


在下文中一共展示了mslib_fe::getProducts方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

         } else {
             $catIds[$page_uid][] = $shopRecord;
         }
     }
 }
 foreach ($catIds as $page_uid => $catIdsToAdd) {
     foreach ($catIdsToAdd as $foreign_cat_id) {
         if ($foreign_cat_id > 0) {
             $insertArray = array();
             $insertArray['categories_id'] = $reflector_cattree[$foreign_cat_id];
             $insertArray['foreign_categories_id'] = $foreign_cat_id;
             $insertArray['page_uid'] = $this->showCatalogFromPage;
             $insertArray['foreign_page_uid'] = $page_uid;
             $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_categories_to_categories', $insertArray);
             $res = $GLOBALS['TYPO3_DB']->sql_query($query);
             $has_products = mslib_fe::getProducts('', $catid);
             if (count($has_products)) {
                 foreach ($has_products as $product_id => $product_data) {
                     $updateArray = array();
                     $updateArray['categories_id'] = $foreign_cat_id;
                     $updateArray['products_id'] = $product_id;
                     $updateArray['sort_order'] = time();
                     $updateArray['page_uid'] = $page_uid;
                     $updateArray['related_to'] = $reflector_cattree[$foreign_cat_id];
                     // create categories tree linking
                     tx_mslib_catalog::linkCategoriesTreeToProduct($product_id, $foreign_cat_id, $updateArray);
                 }
             }
         }
     }
 }
開發者ID:bvbmedia,項目名稱:multishop,代碼行數:31,代碼來源:admin_edit_category.php

示例2: getSitemap

 public function getSitemap($categories_id, $array = array(), $include_disabled_categories = 0, $include_products = 1)
 {
     $str = "SELECT * from tx_multishop_categories c, tx_multishop_categories_description cd where c.page_uid='" . $this->showCatalogFromPage . "' ";
     if (!$include_disabled_categories) {
         $str .= "and c.status=1 ";
     }
     $str .= "and c.parent_id='" . $categories_id . "' and cd.language_id='" . $this->sys_language_uid . "' and c.categories_id=cd.categories_id order by c.sort_order";
     $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
     if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
         // cats
         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) {
             $array['subs'][] = mslib_fe::getSitemap($row['categories_id'], $row, $include_disabled_categories, $include_products);
         }
     } else {
         if ($include_products) {
             // products
             $products = mslib_fe::getProducts('', $categories_id);
             if (is_array($products)) {
                 if (!count($array)) {
                     // starting point doesnt have subcats, but products instead.
                     $array['subs'][0]['products'] = $products;
                 } else {
                     $array['products'] = $products;
                 }
             }
         }
     }
     return $array;
 }
開發者ID:bvbmedia,項目名稱:multishop,代碼行數:29,代碼來源:class.mslib_fe.php


注:本文中的mslib_fe::getProducts方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。