Download
Desenvolver
Conta
Download
Desenvolver
Login
Forgot Account/Password
Criar Conta
Linguagem
Ajuda
Linguagem
Ajuda
×
Login
Nome de acesso
Senha
×
Forgot Account/Password
Estado tradução de Português
Category:
Software
People
PersonalForge
Magazine
Wiki
Pesquisa
OSDN
>
Pesquisar Software
>
Internet
>
WWW/HTTP
>
Site Management
>
osCommerce 日本語版
>
Fóruns
>
osCommerce FAQ
>
ベストセラーカスタマイズ
osCommerce 日本語版
Descrição
Project Summary
Developer Dashboard
Página da Web
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
Histórico
Downloads
List of Releases
Stats
Código Fonte
Code Repository list
CVS
Visualizar Repositório
Tíquete
Ticket List
Milestone List
Type List
Lista de componentes
List of frequently used tickets/RSS
Submit New Ticket
Documents
Communication
Fóruns
List of Forums
イベント (20)
osCommerce カスタマイズ (493)
osCommerce FAQ (1365)
osCommerce 一般 (36)
Mailing Lists
list of ML
tep-j-develop
tep-j-general
News
Fóruns:
osCommerce FAQ
(Thread #24152)
Return to Thread list
RSS
ベストセラーカスタマイズ (2009-10-08 20:47 by
Anônimo
#46302)
Responder
Criar tíquete
ベストセラーの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);
}
Responder a #46302
×
Assunto
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.)
Login
Nickname
Pré-visualizar
Post
Cancelar