• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tep_count_products_in_category函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中tep_count_products_in_category函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_count_products_in_category函数的具体用法?PHP tep_count_products_in_category怎么用?PHP tep_count_products_in_category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了tep_count_products_in_category函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildCategories

 function buildCategories($parent_id)
 {
     global $languages_id;
     $result = '';
     $categories_query = tep_db_query("SELECT c.categories_id, cd.categories_name, c.parent_id FROM categories c, categories_description cd WHERE c.categories_id = cd.categories_id AND cd.language_id = '" . (int) $languages_id . "' AND c.parent_id = '" . $parent_id . "' ORDER BY c.sort_order, cd.categories_name");
     $colcount = tep_db_num_rows($categories_query);
     if ($colcount > 0) {
         if ($colcount > 4) {
             $colcount = 4;
         }
         $result .= '<ul id="products_sitemap" class="col' . $colcount . '">';
         $count = 0;
         while ($categories = tep_db_fetch_array($categories_query)) {
             if ($count == 0) {
                 $result .= '<li class="first">';
             } else {
                 $result .= '<li>';
             }
             $result .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categories['categories_id']) . '" title="' . $categories['categories_name'] . ' - ' . STORE_NAME . '" class="sitemap">' . $categories['categories_name'] . '</a>';
             if (tep_has_category_subcategories($categories['categories_id'])) {
                 $result .= $this->buildCategories($categories['categories_id']);
             } else {
                 if (tep_count_products_in_category($categories['categories_id']) > 0) {
                     //$result .= $this->buildProducts($categories['categories_id']);
                 }
             }
             $result .= '</li>';
             $count++;
         }
         $result .= '</ul>';
     }
     return $result;
 }
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:33,代码来源:category_tree.php


示例2: tep_show_category

function tep_show_category($counter, $count)
{
    global $tree, $categories_string, $cPath_array, $ii;
    if ($count == 0) {
        $kk = ' class="bg_list"';
    } else {
        $kk = ' class="bg_list"';
    }
    $count++;
    if (!$tree[$counter]['level']) {
        $categories_string .= $categories_string ? '' : '';
        $categories_string .= '<li' . $kk . '><a href=';
        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($counter);
            if ($products_in_category > 0) {
                $num_prod = '&nbsp;(' . $products_in_category . ')';
            }
        }
        if ($tree[$counter]['parent'] == 0) {
            $cPath_new = 'cPath=' . $counter;
        } else {
            $cPath_new = 'cPath=' . $tree[$counter]['path'];
        }
        $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
        // display categry name
        $categories_string .= $tree[$counter]['name'];
        $categories_string .= $num_prod . '</a></li>';
    } else {
        // SUBCATEGORY
        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($counter);
            if ($products_in_category > 0) {
                $num_prod = '&nbsp;(' . $products_in_category . ')';
            }
        }
        $count = 2;
        $categories_string .= '';
        $categories_string .= '<li class="bg_list_sub">';
        for ($i = 0; $i < $tree[$counter]['level']; $i++) {
            $categories_string .= '&nbsp;&nbsp;&nbsp;';
        }
        $categories_string .= '<a href=';
        if ($tree[$counter]['parent'] == 0) {
            $cPath_new = 'cPath=' . $counter;
        } else {
            $cPath_new = 'cPath=' . $tree[$counter]['path'];
        }
        $categories_string .= tep_href_link('index.php', $cPath_new) . '>';
        // display category name
        $categories_string .= $tree[$counter]['name'];
        $categories_string .= $num_prod . '</a></li>';
    }
    if ($tree[$counter]['next_id'] != false && $ii < 30) {
        tep_show_category($tree[$counter]['next_id'], $count);
    }
}
开发者ID:laiello,项目名称:hotel-os,代码行数:56,代码来源:categories.php


示例3: tep_show_categoryxc

function tep_show_categoryxc($cid, $cpath, $display_empty)
{
    global $categoriesxc_string, $languages_id, $_GET;
    global $level;
    $selectedPath = array();
    // Get all of the categories on this level
    $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . $cid . " and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id . "' order by sort_order, cd.categories_name");
    while ($categories = tep_db_fetch_array($categories_query)) {
        if ($level[$categories['parent_id']] == "") {
            $level[$categories['parent_id']] = 0;
        }
        $level[$categories['categories_id']] = $level[$categories['parent_id']] + 1;
        // Add category link to $categoriesxc_string
        $products_in_category = tep_count_products_in_category($categories['categories_id']);
        if ($display_empty == 0 && $products_in_category < 1) {
            $display_category = false;
        } else {
            $display_category = true;
        }
        if ($display_category == true) {
            $categoriesxc_string .= "\t<li><a href=\"";
            $cPath_new = $cpath;
            if ($level[$categories['parent_id']] > 0) {
                $cPath_new .= "_";
            }
            $cPath_new .= $categories['categories_id'];
            $cPath_new_text = "cPath=" . $cPath_new;
            $categoriesxc_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
            $categoriesxc_string .= '" title="' . $categories['categories_name'] . '">';
            if ($_GET['cPath']) {
                $selectedPath = split("_", $_GET['cPath']);
            }
            //if (in_array($categories['categories_id'], $selectedPath)) { $categoriesxc_string .= '<strong>'; }
            $categoriesxc_string .= $categories['categories_name'];
            //if (in_array($categories['categories_id'], $selectedPath)) { $categoriesxc_string .= '</strong>'; }
            $categoriesxc_string .= '</a>';
            if (SHOW_COUNTS) {
                if ($products_in_category > 0) {
                    $categoriesxc_string .= '&nbsp;(' . $products_in_category . ')';
                }
            }
            // If I have subcategories, get them and show them
            if (tep_has_category_subcategories($categories['categories_id'])) {
                $categoriesxc_string .= "<ul id=\"catid" . $categories['categories_id'] . "\" title=\"" . $categories['categories_name'] . "\">\n";
                tep_show_categoryxc($categories['categories_id'], $cPath_new, $display_empty);
                $categoriesxc_string .= "</ul>\n";
            }
            $categoriesxc_string .= "</li>\n";
        }
    }
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:51,代码来源:categories-xc.php


示例4: tep_show_category

function tep_show_category($counter)
{
    // Category Optimization
    global $tree, $categories_string, $cPath_array, $parent_child;
    for ($i = 0; $i < $tree[$counter]['level']; $i++) {
        $categories_string .= "&nbsp;&nbsp;";
    }
    $categories_string .= '<a href="';
    if ($tree[$counter]['parent'] == 0) {
        $cPath_new = 'cPath=' . $counter;
    } else {
        $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '<b>';
    }
    // display category name
    $categories_string .= $tree[$counter]['name'];
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '</b>';
    }
    // BOF tep_show_category optimization
    /*    if (tep_has_category_subcategories($counter)) {
          $categories_string .= '-&gt;';
        } */
    //    foreach ($parent_child as $index_of => $sub_parent_child) {
    if ($counter == $sub_parent_child['parent_id']) {
        // a category has this one as a parent, so parent has a subcategory
        $categories_string .= '-&gt;';
        break;
        //	    }
    }
    // end foreach ($parent_child as $index_of => $sub_parent_child)
    // EOF tep_show_category optimization
    $categories_string .= '</a>';
    if (SHOW_COUNTS == 'true') {
        $products_in_category = tep_count_products_in_category($counter);
        if ($products_in_category > 0) {
            $categories_string .= '&nbsp;(' . $products_in_category . ')';
        }
    }
    $categories_string .= '<br>';
    if ($tree[$counter]['next_id'] != false) {
        tep_show_category($tree[$counter]['next_id']);
    }
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:47,代码来源:categories.php


示例5: tep_show_category_row

function tep_show_category_row($counter)
{
    global $tree, $categories_string, $cPath_array;
    $cPath_new = 'cPath=' . $counter;
    $categories_string .= '<span class="headerCategoriesItems">';
    $categories_string .= '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
    $categories_string .= $tree[$counter]['name'];
    $categories_string .= '</a>';
    if (SHOW_COUNTS == 'false') {
        $products_in_category = tep_count_products_in_category($counter);
        if ($products_in_category > 0) {
            $categories_string .= ' (' . $products_in_category . ')';
        }
    }
    $categories_string .= '</span>';
    if ($tree[$counter]['next_id'] != false) {
        tep_show_category_row($tree[$counter]['next_id']);
    }
}
开发者ID:validoc,项目名称:Pikmas,代码行数:19,代码来源:categories-row.php


示例6: tep_show_category

/**
 * $Id: categories.php 57 2005-12-15 14:39:09Z Michael $

 * osCommerce, Open Source E-Commerce Solutions
 * http://www.oscommerce.com

 * Copyright (c) 2003 osCommerce

 * Released under the GNU General Public License

 * adapted 2005 for xoops 2.0.x by FlinkUX e.K. <http://www.flinkux.de>
  
 * (c) 2005  Michael Hammelmann <[email protected]>
 * @package xosC
 * @author Michael Hammelmann <[email protected]>
 * @version 1
**/
function tep_show_category($tmp_counter, $cat_string, $tmp_tree, $cPath_array)
{
    $tree = $tmp_tree;
    $counter = $tmp_counter;
    $categories_string = "";
    for ($i = 0; $i < $tree[$counter]['level']; $i++) {
        $categories_string .= "&nbsp;&nbsp;";
    }
    $categories_string .= '<a href="';
    if ($tree[$counter]['parent'] == 0) {
        $cPath_new = 'cPath=' . $counter;
    } else {
        $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '<b>';
    }
    // display category name
    $categories_string .= $tree[$counter]['name'];
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '</b>';
    }
    if (tep_has_category_subcategories($counter)) {
        $categories_string .= '-&gt;';
    }
    $categories_string .= '</a>';
    if (SHOW_COUNTS == 'true') {
        $products_in_category = tep_count_products_in_category($counter);
        if ($products_in_category > 0) {
            $categories_string .= '&nbsp;(' . $products_in_category . ')';
        }
    }
    $categories_string .= '<br>';
    if ($tree[$counter]['next_id'] != false) {
        // $categories_string.="tep_show_category(".$tree[$counter]['next_id'].",".$categories_string.",".$tree.",".$cPath_array.")";
        $categories_string .= tep_show_category($tree[$counter]['next_id'], $categories_string, $tree, $cPath_array);
    }
    return $categories_string;
}
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:57,代码来源:categories.php


示例7: preorder_mc

function preorder_mc($cid_cat, $level_cat, $foo_cat, $cpath_cat)
{
    global $categories_string_cat, $_GET;
    // Display link
    if ($cid_cat != 0) {
        for ($i = 0; $i < $level_cat; $i++) {
            $categories_string_cat .= '&nbsp;&nbsp;';
        }
        $categories_string_cat .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath
=' . $cpath_cat . $cid_cat) . '">';
        // 1.6 Are we on the "path" to selected category?
        $bold = strstr($_GET['cPath'], $cpath_cat . $cid_cat . '_') || $_GET['cPath'] == $cpath_cat . $cid_cat;
        // 1.6 If yes, use <b>
        if ($bold) {
            $categories_string_cat .= '<b>';
        }
        $categories_string_cat .= $foo_cat[$cid_cat]['name'];
        if ($bold) {
            $categories_string_cat .= '</b>';
        }
        $categories_string_cat .= '</a>';
        // 1.4 SHOW_COUNTS is 'true' or 'false', not true or false
        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($cid_cat);
            if ($products_in_category > 0) {
                $categories_string_cat .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $categories_string_cat .= '<br>';
    }
    // Traverse category tree
    if (is_array($foo_cat)) {
        foreach ($foo_cat as $key => $value) {
            if ($foo_cat[$key]['parent'] == $cid_cat) {
                preorder_mc($key, $level_cat + 1, $foo_cat, $level_cat != 0 ? $cpath_cat . $cid_cat . '_' : '');
            }
        }
    }
}
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:39,代码来源:main_categories.php


示例8: tep_show_category

function tep_show_category($counter)
{
    global $tree, $categories_string, $cPath_array;
    for ($i = 0; $i < $tree[$counter]['level']; $i++) {
        $categories_string .= "&nbsp;&nbsp;";
    }
    $categories_string .= '<a href="';
    if ($tree[$counter]['parent'] == 0) {
        $cPath_new = 'cPath=' . $counter;
    } else {
        $cPath_new = 'cPath=' . $tree[$counter]['path'];
    }
    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '<b>';
    }
    // display category name
    $categories_string .= $tree[$counter]['name'];
    if (isset($cPath_array) && in_array($counter, $cPath_array)) {
        $categories_string .= '</b>';
    }
    if (tep_has_category_subcategories($counter)) {
        $categories_string .= '';
    }
    $categories_string .= '</a>';
    if (SHOW_COUNTS == 'false') {
        $products_in_category = tep_count_products_in_category($counter);
        if ($products_in_category > 0) {
            $categories_string .= '&nbsp;(' . $products_in_category . ')';
        }
    }
    $categories_string .= '<br>';
    if ($tree[$counter]['next_id'] != false) {
        tep_show_category($tree[$counter]['next_id']);
    }
}
开发者ID:validoc,项目名称:Pikmas,代码行数:36,代码来源:categories.php


示例9: build_categories_string

 private function build_categories_string($counter)
 {
     global $cPath_array, $column_location;
     // end background variables
     $this->categories_string .= '<ul class="box-information_pages-ul list-unstyled list-indent-large">';
     $style_padding = "0";
     for ($i = 0; $i < $this->tree[$counter]['level']; $i++) {
         //$this->categories_string .= "&nbsp; &nbsp;";
         $style_padding += 10;
     }
     $css_indent = '';
     if ($style_padding > 0) {
         $css_indent = ' style="padding-left:' . $style_padding . 'px"';
     }
     $this->categories_string .= '<li' . $css_indent . '>';
     $this->categories_string .= '<a href="';
     if ($this->tree[$counter]['parent'] == 0) {
         $cPath_new = 'cPath=' . $counter;
     } else {
         $cPath_new = 'cPath=' . $this->tree[$counter]['path'];
     }
     $this->categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
     if (isset($cPath_array) && in_array($counter, $cPath_array)) {
         $this->categories_string .= '<b>';
     }
     // display category name
     $this->categories_string .= tep_db_decoder($this->tree[$counter]['name']);
     if (isset($cPath_array) && in_array($counter, $cPath_array)) {
         $this->categories_string .= '</b>';
     }
     $this->categories_string .= '</a>';
     if (SHOW_COUNTS == 'true') {
         $products_in_category = tep_count_products_in_category($counter);
         if ($products_in_category > 0) {
             $this->categories_string .= '&nbsp;<span class="category_count">(' . $products_in_category . ')</span>';
         }
     }
     $this->categories_string .= '</li></ul>' . "\n";
     if ($this->tree[$counter]['next_id'] != false) {
         $this->build_categories_string($this->tree[$counter]['next_id']);
     }
 }
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:42,代码来源:box_categories.php


示例10: tep_make_cat_ulbranch

function tep_make_cat_ulbranch($parcat, $table, $level, $maxlevel)
{
    global $cPath_array, $classname_for_selected, $classname_for_parent;
    $list = $table[$parcat];
    while (list($key, $val) = each($list)) {
        if ($GLOBALS['this_level'] != $level) {
            if ($GLOBALS['this_level'] < $level) {
                $output .= "\n" . '<ul>';
            } else {
                for ($nest = 1; $nest <= $GLOBALS['this_level'] - $level; $nest++) {
                    $output .= '</ul></li>' . "\n";
                }
                /*							
                							if ($GLOBALS['this_level'] -1 == $level)
                $output .= '</ul></li>'."\n";
                elseif ($GLOBALS['this_level'] -2 == $level)
                $output .= '</ul></li></ul></li>'."\n";
                elseif ($GLOBALS['this_level'] -3 == $level)
                $output .= '</ul></li></ul></li></ul></li>'."\n";
                elseif ($GLOBALS['this_level'] -4 == $level)
                $output .= '</ul></li></ul></li></ul></li></ul></li>'."\n"; 
                */
            }
            $GLOBALS['this_level'] = $level;
        }
        if (isset($cPath_array) && in_array($key, $cPath_array) && $classname_for_selected) {
            $this_cat_class = ' class="' . $classname_for_selected . '"';
        } else {
            $this_cat_class = '';
        }
        $output .= '<li' . $this_cat_class . '><a href="';
        if (!$level) {
            unset($GLOBALS['cPath_set']);
            $GLOBALS['cPath_set'][0] = $key;
            $cPath_new = 'cPath=' . $key;
        } else {
            $GLOBALS['cPath_set'][$level] = $key;
            $cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, $level + 1));
        }
        if (tep_has_category_subcategories($key) && $classname_for_parent) {
            $this_parent_class = ' class="' . $classname_for_parent . '"';
        } else {
            $this_parent_class = '';
        }
        $output .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '"' . $this_parent_class . '>' . $val;
        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($key);
            if ($products_in_category > 0) {
                $output .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $output .= '</a>';
        if (!tep_has_category_subcategories($key)) {
            $output .= '</li>' . "\n";
        }
        if (isset($table[$key]) and ($maxlevel > $level + 1 or $maxlevel == '0')) {
            $output .= tep_make_cat_ulbranch($key, $table, $level + 1, $maxlevel);
        }
    }
    // End while loop
    return $output;
}
开发者ID:eosc,项目名称:EosC-2.3,代码行数:62,代码来源:ul_categories.php


示例11: build_menus

function build_menus($currentParID, $menustr, $catstr, $indent)
{
    global $categories_string, $id, $languages_id;
    $tmpCount;
    $tmpCount = 0;
    $haschildren = 0;
    //default
    $categories_query_catmenu = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . $currentParID . "' and c.categories_id = cd.categories_id and cd.language_id='" . $languages_id . "' and c.categories_id!=21 and c.categories_id!=23 order by sort_order, cd.categories_name");
    $numberOfRows = tep_db_num_rows($categories_query_catmenu);
    $currentRow = 0;
    while ($categories = tep_db_fetch_array($categories_query_catmenu)) {
        $currentRow++;
        $catName = $categories['categories_name'];
        $tmpCount += 1;
        $haschildren = tep_has_category_subcategories($categories['categories_id']);
        if (SHOW_COUNTS == 'true') {
            $products_in_category = tep_count_products_in_category($categories['categories_id']);
            if ($products_in_category > 0) {
                $catName .= ' (' . $products_in_category . ')';
            }
        }
        if ($catstr != '') {
            $cPath_new = 'cPath=' . $catstr . '_' . $categories['categories_id'];
        } else {
            $indent = 0;
            $cPath_new = 'cPath=' . $categories['categories_id'];
        }
        if ($menustr != '') {
            $menu_tmp = $menustr . '_' . $tmpCount;
        } else {
            $menu_tmp = $tmpCount;
        }
        $indentStr = "";
        for ($i = 0; $i < $indent; $i++) {
            $indentStr .= "   ";
        }
        $categories_string .= $indentStr . "[null, '" . $catName . "','" . tep_href_link(FILENAME_DEFAULT, $cPath_new) . "','_self','" . $tmpString . "'";
        if ($haschildren) {
            $indent += 1;
            $categories_string .= ",\n";
            if ($menustr != '') {
                $menu_tmp = $menustr . '_' . $tmpCount;
            } else {
                $menu_tmp = $tmpCount;
            }
            if ($catstr != '') {
                $cat_tmp = $catstr . '_' . $categories['categories_id'];
            } else {
                $cat_tmp = $categories['categories_id'];
            }
            $NumChildren = build_menus($categories['categories_id'], $menu_tmp, $cat_tmp, $indent);
            if ($currentRow < $numberOfRows) {
                $categories_string .= $indentStr . "],\n";
            } else {
                $categories_string .= $indentStr . "]\n";
            }
        } else {
            if ($currentRow < $numberOfRows) {
                $categories_string .= "],\n";
            } else {
                $categories_string .= "]\n";
            }
            $NumChildren = 0;
        }
    }
    return $tmpCount;
}
开发者ID:rongandat,项目名称:scalaprj,代码行数:67,代码来源:categories.php


示例12: tep_count_products_in_category

function tep_count_products_in_category($category_id, $include_inactive = false)
{
    $OSCOM_Db = Registry::get('Db');
    $products_count = 0;
    $products_query = 'select count(*) as total from :table_products p, :table_products_to_categories p2c where p.products_id = p2c.products_id and p2c.categories_id = :categories_id';
    if ($include_inactive == false) {
        $products_query .= ' and p.products_status = 1';
    }
    $Qproducts = $OSCOM_Db->prepare($products_query);
    $Qproducts->bindInt(':categories_id', $category_id);
    $Qproducts->execute();
    if ($Qproducts->fetch() !== false) {
        $products_count += $Qproducts->valueInt('total');
    }
    $Qcategories = $OSCOM_Db->prepare('select categories_id from :table_categories where parent_id = :parent_id');
    $Qcategories->bindInt(':parent_id', $category_id);
    $Qcategories->execute();
    if ($Qcategories->fetch() !== false) {
        do {
            $products_count += tep_count_products_in_category($Qcategories->valueInt('categories_id'), $include_inactive);
        } while ($Qcategories->fetch());
    }
    return $products_count;
}
开发者ID:Akofelaz,项目名称:oscommerce2,代码行数:24,代码来源:general.php


示例13: tep_show_category3

function tep_show_category3($cid, $cpath, $COLLAPSABLE, $level = 0)
{
    global $categories_string3, $languages_id, $categories;
    $selectedPath = array();
    // Get all of the categories on this level
    $level++;
    $customer_group_array = array();
    if (!isset($_SESSION['sppc_customer_group_id'])) {
        $customer_group_array[] = 'G';
    } else {
        $customer_group_array = tep_get_customers_access_group($_SESSION['customer_id']);
    }
    $categories_query_raw = "SELECT c.categories_id, cd.categories_name, c.parent_id\r\n                             from " . TABLE_CATEGORIES . " c,\r\n                                  " . TABLE_CATEGORIES_DESCRIPTION . " cd\r\n                           WHERE c.parent_id = '" . $cid . "'\r\n                             and c.categories_id = cd.categories_id\r\n                             and cd.language_id='" . $languages_id . "'";
    $categories_query_raw .= tep_get_access_sql('c.products_group_access', $customer_group_array);
    $categories_query_raw .= " ORDER BY sort_order, cd.categories_name";
    $categories_query = tep_db_query($categories_query_raw);
    while ($categories = tep_db_fetch_array($categories_query)) {
        if (!isset($categories[$level]['parent_id']) || $categories[$level]['parent_id'] == "") {
            $categories[$level]['parent_id'] = 0;
        }
        $categories[$level]['categories_id'] = $categories[$level]['parent_id'] + 1;
        // Add category link to $categories_string3
        for ($a = 1; $a < $level; $a++) {
            $categories_string3 .= "&nbsp;&nbsp;";
        }
        $categories_string3 .= '<a href="';
        $cPath_new = $cpath;
        // if ($categories[$level]['parent_id'] > 0) {
        if ($categories['parent_id'] > 0) {
            $cPath_new .= "_";
        }
        $cPath_new .= $categories['categories_id'];
        // added for CDS CDpath support
        $CDpath = isset($_SESSION['CDpath']) ? '&CDpath=' . $_SESSION['CDpath'] : '';
        $cPath_new_text = "cPath=" . $cPath_new . $CDpath;
        $categories_string3 .= tep_href_link(FILENAME_DEFAULT, $cPath_new_text);
        $categories_string3 .= '">';
        if ($_GET['cPath']) {
            $selectedPath = explode("_", $_GET['cPath']);
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '<b>';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '<u>';
        }
        $categories_string3 .= tep_db_decoder($categories['categories_name']);
        if ($COLLAPSABLE && tep_has_category_subcategories($categories['categories_id'])) {
            $categories_string3 .= ' ->';
        }
        if ($categories[$level]['categories_id'] == 1) {
            $categories_string3 .= '</u>';
        }
        if (in_array($categories['categories_id'], $selectedPath)) {
            $categories_string3 .= '</b>';
        }
        $categories_string3 .= '</a>';
        if (SHOW_COUNTS) {
            $products_in_category = tep_count_products_in_category($categories['categories_id']);
            if ($products_in_category > 0) {
                $categories_string3 .= '&nbsp;(' . $products_in_category . ')';
            }
        }
        $categories_string3 .= '<br>';
        // If I have subcategories, get them and show them
        if (tep_has_category_subcategories($categories['categories_id'])) {
            if ($COLLAPSABLE) {
                if (in_array($categories['categories_id'], $selectedPath)) {
                    tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
                }
            } else {
                tep_show_category3($categories['categories_id'], $cPath_new, $COLLAPSABLE, $level);
            }
        }
    }
}
开发者ID:resultsonlyweb,项目名称:loaded6-template,代码行数:76,代码来源:categories3.php


示例14: tep_get_categories_breadcrumb

function tep_get_categories_breadcrumb($cat_id, $extension, $breadcrumb = '')
{
    $query = tep_db_query('SELECT cd.categories_name, c.parent_id FROM categories c, categories_description cd WHERE c.categories_id = cd.categories_id AND cd.categories_id = "' . $cat_id . '" AND cd.language_id = 1');
    while ($cats_name = tep_db_fetch_array($query)) {
        if (tep_count_products_in_category($cat_id) > 0) {
            $type = 'products';
        } else {
            $subcats = tep_db_query('SELECT categories_id FROM categories WHERE parent_id = "' . $cat_id . '"');
            if (tep_db_num_rows($subcats) > 0) {
                $type = 'categories';
            } else {
                $type = 'none';
            }
        }
        $breadcrumb = '<a href="' . tep_href_link('index.php', 'extension=' . $extension . '&type=' . $type . '&cPath=' . $cat_id) . '" title="' . $cats_name['categories_name'] . '">' . $cats_name['categories_name'] . '</a> >> ' . $breadcrumb;
        if ($cats_name['parent_id'] == 0) {
            return substr($breadcrumb, 0, -3);
        } else {
            return tep_get_categories_breadcrumb($cats_name['parent_id'], $extension, $breadcrumb);
        }
    }
}
开发者ID:CristianCCIT,项目名称:shop4office,代码行数:22,代码来源:general.php


示例15: generate_shopinfo


//.........这里部分代码省略.........
        $street = & $address->addChild("Street");
        $city = & $address->addChild("City");
    */
    if (emailOk()) {
        $contact =& $root->addChild("Contact");
        $publicMailAddress =& $contact->addChild("PublicMailAddress", STORE_OWNER_EMAIL_ADDRESS);
        $privateMailAddress =& $contact->addChild("PrivateMailAddress", STORE_OWNER_EMAIL_ADDRESS);
    }
    /*
    $orderPhone = & $contact->addChild("OrderPhone");
        $number= & $orderPhone->addChild("Number");
        $costPerMinute= & $orderPhone->addChild("CostPerMinute");
    $orderFax= & $contact->addChild("OrderFax");
        $number = & $orderFax->addChild("Number");
        $costPerMinute= & $orderFax->addChild("CostPerMinute");
    $hotline = & $contact->addChild("Hotline");
    */
    $prodSum = productAnz();
    $categories =& $root->addChild("Categories");
    if ($prodSum > 0) {
        $totalProductCount =& $categories->addChild("TotalProductCount", $prodSum);
    }
    $ns = ELMAR_NEW_SHOPINFO_XML ? 'c:' : '';
    $attrib = ELMAR_NEW_SHOPINFO_XML ? array('lang' => $language_code) : NULL;
    $mapOther = $language_code == 'de' ? 'Sonstiges' : 'Other';
    // Die Produktkategorien der ersten Ebene schreiben. Durch "group by" Doppelte herauswerfen.
    $categories_query = tep_db_query('select c.categories_id, cd.categories_name from ' . TABLE_CATEGORIES . ' c left join ' . TABLE_CATEGORIES_DESCRIPTION . ' cd using(categories_id) where c.parent_id=0 and cd.language_id=' . (int) $languages_id . ' group by cd.categories_name');
    if (tep_db_num_rows($categories_query)) {
        while ($category = tep_db_fetch_array($categories_query)) {
            $categories_name = trim($category['categories_name']);
            if ($categories_name != '') {
                $item =& $categories->addChild("Item", NULL, $attrib);
                $name =& $item->addChild($ns . "Name", $categories_name);
                if (function_exists('tep_count_products_in_category') && ($cpic = tep_count_products_in_category($category['categories_id']))) {
                    $productCount =& $item->addChild($ns . "ProductCount", $cpic);
                }
                $mapping =& $item->addChild($ns . "Mapping", KategorieAnpassen($category['categories_name'], $mapOther));
            }
        }
    } else {
        $item =& $categories->addChild("Item", NULL, $attrib);
        $name =& $item->addChild($ns . "Name", $mapOther);
        if ($prodSum > 0) {
            $productCount =& $item->addChild($ns . "ProductCount", $prodSum);
        }
        $mapping =& $item->addChild($ns . "Mapping", $mapOther);
    }
    $lastschriftverfahren = defined('MODULE_PAYMENT_BANKTRANSFER_STATUS') && MODULE_PAYMENT_BANKTRANSFER_STATUS == 'True' ? true : false;
    $nachnahme = defined('MODULE_PAYMENT_COD_STATUS') && MODULE_PAYMENT_COD_STATUS == 'True' ? true : false;
    $paypal = defined('MODULE_PAYMENT_PAYPAL_STATUS') && MODULE_PAYMENT_PAYPAL_STATUS == 'True' ? true : false;
    $rechnung = defined('MODULE_PAYMENT_INVOICE_STATUS') && MODULE_PAYMENT_INVOICE_STATUS == 'True' ? true : false;
    $vorkasse = defined('MODULE_PAYMENT_MONEYORDER_STATUS') && MODULE_PAYMENT_MONEYORDER_STATUS == 'True' ? true : false;
    #$barzahlung = (defined('MODULE_PAYMENT_CASH_STATUS') && (MODULE_PAYMENT_CASH_STATUS == 'True')) ? true : false;
    #e-cash (elektronisches Zahlungsmittel); money transfer (Ueberweisung); cheque (Scheck)
    if ($nachnahme || $paypal || $lastschriftverfahren || $rechnung || $vorkasse) {
        $payment =& $root->addChild("Payment");
        if ($nachnahme) {
            $item =& $payment->addChild("Item");
            $name =& $item->addChild("Name", 'on delivery');
            // Nachnahme
            //$surcharge = & $item->addChild("Surcharge");
            //$maxSurcharge = & $item->addChild("MaxSurcharge");
            //$relativeSurcharge = & $item->addChild("RelativeSurcharge");
        }
        if ($paypal) {
            $item =& $payment->addChild("Item");
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:67,代码来源:elmar.inc.php


示例16: tep_count_products_in_category

function tep_count_products_in_category($category_id, $include_inactive = false)
{
    // BOF Separate Pricing Per Customer, hide products and categories for groups
    global $sppc_customer_group_id;
    if (!tep_session_is_registered('sppc_customer_group_id')) {
        $customer_group_id = '0';
    } else {
        $customer_group_id = $sppc_customer_group_id;
    }
    $products_count = 0;
    if ($include_inactive == true) {
        $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id = p2c.products_id and p2c.categories_id = '" . (int) $category_id . "' and find_in_set('" . $customer_group_id . "', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
    } else {
        $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int) $category_id . "' and find_in_set('" . $customer_group_id . "', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
    }
    $products = tep_db_fetch_array($products_query);
    $products_count += $products['total'];
    // no need to find child categories that are hidden from this customer or have a higher level category that is hidden
    $child_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int) $category_id . "' and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
    // EOF Separate Pricing Per Customer, hide products and categories for groups
    if (tep_db_num_rows($child_categories_query)) {
        while ($child_categories = tep_db_fetch_array($child_categories_query)) {
            $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive);
        }
    }
    return $products_count;
}
开发者ID:digideskio,项目名称:oscmax2,代码行数:27,代码来源:general.php


示例17: tep_count_products_in_category

function tep_count_products_in_category($category_id, $include_inactive = false)
{
    $products_count = 0;
    if ($include_inactive == true) {
        $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p2c.categories_id = '" . (int) $category_id . "'");
    } else {
        $products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '" . (int) $category_id . "'");
    }
    $products = tep_db_fetch_array($products_query);
    $products_count += $products['total'];
    $child_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . " where parent_id = '" . (int) $category_id . "'");
    if (tep_db_num_rows($child_categories_query)) {
        while ($child_categories = tep_db_fetch_array($child_categories_query)) {
            $products_count += tep_count_products_in_category($child_categories['categories_id'], $include_inactive);
        }
    }
    return $products_count;
}
开发者ID:katapofatico,项目名称:Responsive-osCommerce,代码行数:18,代码来源:general.php


示例18: tep_show_category

 function tep_show_category($counter)
 {
     $boxContent = '';
     $catlevel = '0';
     $boxContent .= '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
     // BoF - Contribution Category Box Enhancement 1.1
     global $tree, $boxContent, $cPath_array, $cat_name, $customer_group_id, $box_width;
     $cPath_new = 'cPath=' . $tree[$counter]['path'];
     $boxContent .= '<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr';
     for ($i = 0; $i < $tree[$counter]['level']; $i++) {
         $catlevel .= $i;
     }
     $boxContent .= ' class="level' . $catlevel . '">';
     // Add control for detecting last item in menu
     if ($tree[$counter]['next_id'] != false) {
         $boxContent .= '<td width="' . $box_width . '" class="menuItem">';
     } else {
         $boxContent .= '<td width="' . $box_width . '" class="menuItemLast">';
     }
     for ($i = 0; $i < $tree[$counter]['level']; $i++) {
         $boxContent .= "&nbsp;&nbsp;";
     }
     $boxContent .= '<a class="' . $catlevel . 'level" href="';
     $boxContent .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
     if (tep_has_category_subcategories($counter)) {
         $boxContent .= tep_image(DIR_WS_ICONS . 'pointer_blue.gif', '');
     } else {
         $boxContent .= tep_image(DIR_WS_ICONS . 'pointe 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tep_count_shipping_modules函数代码示例发布时间:2022-05-23
下一篇:
PHP tep_count_modules函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap