下載
軟體開發
帳戶
下載
軟體開發
登入
我忘記帳戶名和密碼了
新增帳戶
語言
手冊
語言
手冊
×
登入
登入名稱
密碼
×
我忘記帳戶名和密碼了
繁體中文翻譯狀態
類別:
軟體
人
PersonalForge
Magazine
Wiki
搜尋
OSDN
>
軟體搜索
>
Internet
>
WWW/HTTP
>
Site Management
>
osCommerce 日本語版
>
討論區
>
osCommerce FAQ
>
ベストセラーカスタマイズ
osCommerce 日本語版
描述
專案概要
開發人員儀表板
專案的網頁
Developers
Image Gallery
List of RSS Feeds
活動
使用統計
歷史
檔案下載
發布列表
Stats
原始碼
儲存庫列表
CVS
查看儲存庫
待辦事項
待辦事項列表
里程碑列表
類型列表
元件列表
List of frequently used tickets/RSS
新增待辦事項
文檔
溝通
討論區
討論區列表
イベント (20)
osCommerce カスタマイズ (493)
osCommerce FAQ (1365)
osCommerce 一般 (36)
通信論壇
通信論壇列表
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
×
主題
內容
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
取消