下载
开发软件
账户
下载
开发软件
登录
我忘记用户名和密码了
创建帐户
语言
帮助
语言
帮助
×
登录
登录名
密码
×
我忘记用户名和密码了
简体中文翻译状态
类别:
软件
用户
PersonalForge
Magazine
Wiki
搜索
OSDN
>
浏览软件
>
Internet
>
WWW/HTTP
>
Site Management
>
osCommerce 日本語版
>
论坛
>
osCommerce FAQ
>
ベストセラーカスタマイズ
osCommerce 日本語版
描述
项目概述
开发人员仪表板
项目的网页
开发人员
Image Gallery
List of RSS Feeds
Activity
统计
历史
下载
List of Releases
统计
源代码
Code Repository list
CVS
查看仓库
任务单
Ticket List
里程碑列表
Type List
组件列表
List of frequently used tickets/RSS
Submit New Ticket
文档
沟通
论坛
List of Forums
イベント (20)
osCommerce カスタマイズ (493)
osCommerce FAQ (1365)
osCommerce 一般 (36)
Mailing Lists
list of ML
tep-j-develop
tep-j-general
新闻
论坛:
osCommerce FAQ
(Thread #24152)
Return to Thread list
RSS
ベストセラーカスタマイズ (2009-10-08 20:47 by
匿名
#46302)
回复
Create ticket
ベストセラーの30日での期間指定ですが、下記のように変更しましたが、
ベストセラーが表示されません。何か間違っていますでしょうか?
(変更前)
if (isset($current_category_id) && ($current_category_id > 0)) {
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $new_products_category_id);
$where_str = " and (c.parent_id = '" . $new_products_category_id . "'";
for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
$where_str .= " or c.categories_id = '" . $subcategories_array[$i] . "'";
}
$where_str .= ")";
$best_sellers_query = tep_db_query("select distinct p.products_id,p.products_image,pd.products_name,pd.products_description ,p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id " . $where_str . " order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
} else {
$best_sellers_query = tep_db_query("select distinct p.products_id,p.products_image,pd.products_name,pd.products_description ,p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
}
if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
?>
(変更後)
if (isset($current_category_id) && ($current_category_id > 0)) {
$subcategories_array = array();
tep_get_subcategories($subcategories_array, $new_products_category_id);
$where_str = " and (c.parent_id = '" . $new_products_category_id . "'";
for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
$where_str .= " or c.categories_id = '" . $subcategories_array[$i] . "'";
}
$where_str .= ")";
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, sum(op.products_quantity) as products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op where op.products_id = p.products_id and op.orders_id = o.orders_id and o.date_purchased >= DATE_SUB(now(), INTERVAL 30 DAY) and p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . $current_category_id . "' in (c.categories_id, c.parent_id) group by op.products_id order by products_quantity desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
} else {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, sum(op.products_quantity) as products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op where op.products_id = p.products_id and op.orders_id = o.orders_id and o.date_purchased >= DATE_SUB(now(), INTERVAL 30 DAY) and p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' group by op.products_id order by products_quantity desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
}
回复到 #46302
×
主体
Body
Reply To Message #46302 > ベストセラーの30日での期間指定ですが、下記のように変更しましたが、 > ベストセラーが表示されません。何か間違っていますでしょうか? > > (変更前) > if (isset($current_category_id) && ($current_category_id > 0)) { > $subcategories_array = array(); > tep_get_subcategories($subcategories_array, $new_products_category_id); > $where_str = " and (c.parent_id = '" . $new_products_category_id . "'"; > for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { > $where_str .= " or c.categories_id = '" . $subcategories_array[$i] . "'"; > } > $where_str .= ")"; > $best_sellers_query = tep_db_query("select distinct p.products_id,p.products_image,pd.products_name,pd.products_description ,p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id " . $where_str . " order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); > } else { > $best_sellers_query = tep_db_query("select distinct p.products_id,p.products_image,pd.products_name,pd.products_description ,p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id , " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); > } > > if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) { > ?> > > > (変更後) > > if (isset($current_category_id) && ($current_category_id > 0)) { > $subcategories_array = array(); > tep_get_subcategories($subcategories_array, $new_products_category_id); > $where_str = " and (c.parent_id = '" . $new_products_category_id . "'"; > for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) { > $where_str .= " or c.categories_id = '" . $subcategories_array[$i] . "'"; > } > $where_str .= ")"; > $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, sum(op.products_quantity) as products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op where op.products_id = p.products_id and op.orders_id = o.orders_id and o.date_purchased >= DATE_SUB(now(), INTERVAL 30 DAY) and p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . $current_category_id . "' in (c.categories_id, c.parent_id) group by op.products_id order by products_quantity desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); > } else { > $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, sum(op.products_quantity) as products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op where op.products_id = p.products_id and op.orders_id = o.orders_id and o.date_purchased >= DATE_SUB(now(), INTERVAL 30 DAY) and p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' group by op.products_id order by products_quantity desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS); > } > > > > > >
You can not use Wiki syntax
You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.)
登录
Nickname
预览
Post
取消