当前位置: 首页>>代码示例>>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;未经允许,请勿转载。