Zen Cart の ベストセラーが表示しない

PHP 5.5 の環境に変更後

Zen Cart の ベストセラー が表示しなくなりました

また、以下のエラーが表示している状態でした。

1194 Table 'products_description' is marked as crashed and should be repaired
in:
[select distinct p.products_id, pd.products_name, p.products_ordered from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '2' order by p.products_ordered desc, pd.products_name limit 10]

解決方法を確認するとありました

こちらのサイトの情報で修正する事で表示するようになりました

Excluding a product or category from best selling list

以下の内容に変更する事で表示するようになりました

変更部分

/includes/modules/sideboxes/best_sellers.php

best_sellers.php を修正する事で解決しました


<!--?php /**  * best_sellers sidebox - displays selected number of (usu top ten) best selling products  *  * @package templateSystem  * @copyright Copyright 2003-2005 Zen Cart Development Team  * @copyright Portions Copyright 2003 osCommerce  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0  * @version $Id: best_sellers.php 2718 2005-12-28 06:42:39Z drbyte $  */ // test if box should display   $show_best_sellers= false;   if (isset($_GET&#91;'products_id'&#93;)) {     if (isset($_SESSION&#91;'customer_id'&#93;)) {       $check_query = "select count(*) as count                       from " . TABLE_CUSTOMERS_INFO . "                       where customers_info_id = '" . (int)$_SESSION&#91;'customer_id'&#93; . "'                       and global_product_notifications = '1'";       $check = $db--->Execute($check_query);

if ($check-&gt;fields['count'] &gt; 0) {
$show_best_sellers= true;
}
}
} else {
$show_best_sellers= true;
}

if ($show_best_sellers == true) {
if (isset($current_category_id) &amp;&amp; ($current_category_id &gt; 0)) {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, "
. TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c
where (p.products_status = '1'
and p.products_ordered &gt; 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id))
and p.products_id not in (52, 43)" . "

order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;

$best_sellers = $db-&gt;Execute($best_sellers_query);

} else {
$best_sellers_query = "select distinct p.products_id, pd.products_name, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where (p.products_status = '1'
and p.products_ordered &gt; 0
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "')
and p.products_id not in (52, 43)" . "

order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;

$best_sellers = $db-&gt;Execute($best_sellers_query);
}

if ($best_sellers-&gt;RecordCount() &gt;= MIN_DISPLAY_BESTSELLERS) {
$title = BOX_HEADING_BESTSELLERS;
$box_id = 'bestsellers';
$rows = 0;
while (!$best_sellers-&gt;EOF) {
$rows++;
$bestsellers_list[$rows]['id'] = $best_sellers-&gt;fields['products_id'];
$bestsellers_list[$rows]['name'] = $best_sellers-&gt;fields['products_name'];
$best_sellers-&gt;MoveNext();
}

$title_link = false;
require($template-&gt;get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template-&gt;get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
}
?&gt;

コメントを残す

サブコンテンツ

カレンダー

2017年10月
« 3月    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

賢威

電脳卸

天気予報


-天気予報コム-

お奨め情報

COUNTER

合計:64004
本日:56
昨日:21
訪問者:0

このページの先頭へ