本文整理汇总了PHP中zen_get_categories_products_list函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_categories_products_list函数的具体用法?PHP zen_get_categories_products_list怎么用?PHP zen_get_categories_products_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_get_categories_products_list函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: zen_get_categories_products_list
function zen_get_categories_products_list($categories_id, $include_deactivated = false, $include_child = true)
{
global $db;
global $categories_products_id_list;
if ($include_deactivated) {
$products = $db->Execute("select p.products_id\r\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c\r\n where p.products_id = p2c.products_id\r\n and p2c.categories_id = '" . (int) $categories_id . "'");
} else {
$products = $db->Execute("select p.products_id\r\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c\r\n where p.products_id = p2c.products_id\r\n and p.products_status = '1'\r\n and p2c.categories_id = '" . (int) $categories_id . "'");
}
while (!$products->EOF) {
// categories_products_id_list keeps resetting when category changes ...
// echo 'Products ID: ' . $products->fields['products_id'] . '<br>';
$categories_products_id_list[] = $products->fields['products_id'];
$products->MoveNext();
}
if ($include_child) {
$childs = $db->Execute("select categories_id from " . TABLE_CATEGORIES . "\r\n where parent_id = '" . (int) $categories_id . "'");
if ($childs->RecordCount() > 0) {
while (!$childs->EOF) {
zen_get_categories_products_list($childs->fields['categories_id'], $include_deactivated);
$childs->MoveNext();
}
}
}
$products_id_listing = $categories_products_id_list;
return $products_id_listing;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:27,代码来源:functions_categories.php
示例2: die
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: new_products.php 8730 2008-06-28 01:31:22Z drbyte $
*/
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
// initialize vars
$categories_products_id_list = '';
$list_of_products = '';
$new_products_query = '';
$display_limit = zen_get_new_date_range();
if ($manufacturers_id > 0 && $_GET['filter_id'] == 0 || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0 || (!isset($new_products_category_id) || $new_products_category_id == '0')) {
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,\n p.products_date_added, p.products_price, p.products_type, p.master_categories_id\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n where p.products_id = pd.products_id\n and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and p.products_status = 1 " . $display_limit;
} else {
// get all products and cPaths in this subcat tree
$productsInCategory = zen_get_categories_products_list($manufacturers_id > 0 && $_GET['filter_id'] > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath, false, true, 0, $display_limit);
if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
// build products-list string to insert into SQL query
foreach ($productsInCategory as $key => $value) {
$list_of_products .= $key . ', ';
}
$list_of_products = substr($list_of_products, 0, -2);
// remove trailing comma
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,\n p.products_date_added, p.products_price, p.products_type, p.master_categories_id\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n where p.products_id = pd.products_id\n and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'\n and p.products_status = 1\n and p.products_id in (" . $list_of_products . ")";
}
}
if ($new_products_query != '') {
$new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);
}
$row = 0;
$col = 0;
开发者ID:ygeneration666,项目名称:ec,代码行数:31,代码来源:new_products.php
示例3: zen_get_categories_products_list
function zen_get_categories_products_list($categories_id, $include_deactivated = false, $include_child = true, $parent_category = '0', $display_limit = '')
{
global $db;
global $categories_products_id_list;
$childCatID = str_replace('_', '', substr($categories_id, strrpos($categories_id, '_')));
$current_cPath = ($parent_category != '0' ? $parent_category . '_' : '') . $categories_id;
$sql = "select p.products_id\n from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c\n where p.products_id = p2c.products_id\n and p2c.categories_id = '" . (int) $childCatID . "'" . ($include_deactivated ? " and p.products_status = 1" : "") . $display_limit;
$products = $db->Execute($sql);
while (!$products->EOF) {
$categories_products_id_list[$products->fields['products_id']] = $current_cPath;
$products->MoveNext();
}
if ($include_child) {
$sql = "select categories_id from " . TABLE_CATEGORIES . "\n where parent_id = '" . (int) $childCatID . "'";
$childs = $db->Execute($sql);
if ($childs->RecordCount() > 0) {
while (!$childs->EOF) {
zen_get_categories_products_list($childs->fields['categories_id'], $include_deactivated, $include_child, $current_cPath, $display_limit);
$childs->MoveNext();
}
}
}
return $categories_products_id_list;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:24,代码来源:functions_categories.php
示例4: foreach
if ($data !== false) {
foreach ($data as $key => $d) {
$data[$key] = mb_convert_encoding($d, MODULE_PRODUCT_CSV_EXPORT_CHARACTER, MODULE_PRODUCT_CSV_INTERNAL_CHARACTER);
$data[$key] = str_replace("\r\n", "\n", $data[$key]);
}
File_CSV::write($tempfile, $data, $conf);
}
}
}
}
break;
case 3:
$prefix = 'options_';
// get products_id
$categories_products_id_list = array();
$products_ids = zen_get_categories_products_list($_POST['category_id'], true, true);
$products_ids = array_unique($products_ids);
// write line
foreach ($products_ids as $val) {
$attributes_ids = zen_get_attributes($val);
foreach ($attributes_ids as $id) {
$data = $ProductCSV->getExportDataOption($id, $format);
if (count($data) == 0) {
continue;
}
foreach ($data as $key => $d) {
$data[$key] = mb_convert_encoding($d, MODULE_PRODUCT_CSV_EXPORT_CHARACTER, MODULE_PRODUCT_CSV_INTERNAL_CHARACTER);
$data[$key] = str_replace("\r\n", "\n", $data[$key]);
}
File_CSV::write($tempfile, $data, $conf);
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:31,代码来源:admin.php
注:本文中的zen_get_categories_products_list函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论