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


PHP Shop::getCategories方法代碼示例

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


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

示例1: unset

             $order .= " asc";
         }
         if ($_GET['order'] == 'desc') {
             $order .= " desc";
         }
     }
     unset($url[$n]);
     unset($current_url_pages[count($current_url_pages) - 1]);
 }
 $smarty->assign("dir", $dirs);
 for ($f = 0; $f < count($cat_list); $f++) {
     $url_to_check = implode("/", $url) . '/';
     if ($cat_list[$f]['full_url'] == $url_to_check) {
         $cat_content = $cat_list[$f];
         if (empty($cat_content['param_level'])) {
             $categories = $shop->getCategories(1);
             if (!empty($categories[0]['id'])) {
                 $redirectUrl = $shop->getFullUrlCategory($categories[0]['id'], 'catalog');
                 header("Location: " . BASE_URL . '/' . $redirectUrl);
                 die;
             }
         }
         $page_found = true;
         if (isset($title_template)) {
             $page_title = $title_template;
         } else {
             if ($cat_content['name'] != '/') {
                 $page_title = $cat_content['name'];
             }
         }
         if ($cat_content['meta_keywords'] != '') {
開發者ID:askovorodka,項目名稱:sqc,代碼行數:31,代碼來源:shop.f_main.php

示例2: initCategoriesAssociation

 public function initCategoriesAssociation($id_root = null)
 {
     if (is_null($id_root)) {
         $id_root = Configuration::get('PS_ROOT_CATEGORY');
     }
     $id_shop = (int) Tools::getValue('id_shop');
     $shop = new Shop($id_shop);
     $selected_cat = Shop::getCategories($id_shop);
     if (empty($selected_cat)) {
         // get first category root and preselect all these children
         $root_categories = Category::getRootCategories();
         $root_category = new Category($root_categories[0]['id_category']);
         $children = $root_category->getAllChildren($this->context->language->id);
         $selected_cat[] = $root_categories[0]['id_category'];
         foreach ($children as $child) {
             $selected_cat[] = $child->id;
         }
     }
     if (Shop::getContext() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop')) {
         $root_category = new Category($shop->id_category);
     } else {
         $root_category = new Category($id_root);
     }
     $root_category = array('id_category' => $root_category->id, 'name' => $root_category->name[$this->context->language->id]);
     $helper = new Helper();
     return $helper->renderCategoryTree($root_category, $selected_cat, 'categoryBox', false, true);
 }
開發者ID:gks-stage,項目名稱:prestashop,代碼行數:27,代碼來源:AdminShopController.php

示例3:

        ?>
                <div class="product-item">
                    <div class="product-image">
                        <img src="http://www.perseybaby.ru/files/image/lampochka.jpg"/>
                    </div>
                    <div class="product-title"><?php 
        echo $product->getName();
        ?>
</div>
                    <div class="product-price"><?php 
        echo $product->getPrice();
        ?>
 руб</div>
                </div>
            <?php 
    }
    ?>
        <?php 
}
?>
    </div>
    <nav id="menu">
        <?php 
echo Shop::menu(Shop::getCategories());
?>
    </nav>
</div>


</body>
</html>
開發者ID:andomiell,項目名稱:electro-centr,代碼行數:31,代碼來源:index.php


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