hi, Ajeh,
Many thanks for our suggestion.
I tried , but the free shipping icon still not shown in best seller in sidebox.
here is the code. could you please help to check how to modify?
appreciated again.
includes\templates\template_default\sideboxes\tpl_best_sellers.php
HTML Code:
<?php
/**
* Side Box Template
*
* @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: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
* @version $Id: tpl_best_sellers.php 2982 2007-12-15 21:00:00 TRUST IT - www.trustit.ca - [email protected] $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
$content .= '<div class="wrapper"><table cellpadding=0 cellspacing=0 border=0>' . "\n";
for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
$imgLink = DIR_WS_IMAGES . $bestsellers_list[$i]['image'];
if ($i==2) {$content .= '<tr><td colspan=2><hr></td></tr>';}
$content .= '<tr><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_image($imgLink, zen_trunc_string($bestsellers_list[$i]['name']), SMALL_IMAGE_WIDTH/2, SMALL_IMAGE_HEIGHT/2) . '</a></td><td valign=top><a href="' . zen_href_link(zen_get_info_page($bestsellers_list[$i]['id']), 'products_id=' . $bestsellers_list[$i]['id']) . '">' . zen_trunc_string($bestsellers_list[$i]['name'], BEST_SELLERS_TRUNCATE, BEST_SELLERS_TRUNCATE_MORE) . '</a><BR><div align=right>' . zen_get_products_display_price($bestsellers_list[$i]['id']) . '</div></td></tr>' . "\n";
}
$content .= '</table></div>' . "\n";
$content .= '</div>';
?>
and the file includes\modules\sideboxes\best_sellers.php
HTML Code:
<?php
/**
* Side Box Template
*
* @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: tpl_best_sellers.php 2982 2006-02-07 07:56:41Z birdbrain $
* @version $Id: tpl_best_sellers.php 2982 2007-12-15 21:00:00 TRUST IT - www.trustit.ca - [email protected] $
*/
// test if box should display
$show_best_sellers= false;
if (isset($_GET['products_id'])) {
if (isset($_SESSION['customer_id'])) {
$check_query = "select count(*) as count
from " . TABLE_CUSTOMERS_INFO . "
where customers_info_id = '" . (int)$_SESSION['customer_id'] . "'
and global_product_notifications = '1'";
$check = $db->Execute($check_query);
if ($check->fields['count'] > 0) {
$show_best_sellers= true;
}
}
} else {
$show_best_sellers= true;
}
if ($show_best_sellers == true) {
if (isset($current_category_id) && ($current_category_id > 0)) {
$best_sellers_query = "select distinct p.products_id, p.products_image, pd.products_name, p.products_price, 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 > 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)
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
$best_sellers = $db->Execute($best_sellers_query);
} else {
$best_sellers_query = "select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_ordered
from " . TABLE_PRODUCTS . " p, " . 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 = '" . (int)$_SESSION['languages_id'] . "'
order by p.products_ordered desc, pd.products_name
limit " . MAX_DISPLAY_BESTSELLERS;
$best_sellers = $db->Execute($best_sellers_query);
}
if ($best_sellers->RecordCount() >= MIN_DISPLAY_BESTSELLERS) {
$title = BOX_HEADING_BESTSELLERS;
$box_id = bestsellers;
$rows = 0;
while (!$best_sellers->EOF) {
$rows++;
$bestsellers_list[$rows]['id'] = $best_sellers->fields['products_id'];
$bestsellers_list[$rows]['name'] = $best_sellers->fields['products_name'];
$bestsellers_list[$rows]['image'] = $best_sellers->fields['products_image'];
$bestsellers_list[$rows]['price'] = $best_sellers->fields['products_price'];
$best_sellers->MoveNext();
}
$left_corner = false;
$right_corner = false;
$right_arrow = false;
$title_link = false;
require($template->get_template_dir('tpl_best_sellers.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_best_sellers.php');
$title = BOX_HEADING_BESTSELLERS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
}
?>