Thanks for the suggestions so far guys.
Originally Posted by
stevesh
You could edit includes/templates/template_default/sideboxes/tpl_featured.php to remove the image and price and save the edited file to your custom template folder. Can't help with adding the numeration (1. 2. etc.)
...I'm not able to remove the image and price myself, I don't know my way around PHP enough
I'm using the default includes/templates/template_default/sideboxes/tpl_featured.php file:
PHP Code:
<?php
/**
* Side Box Template
*
* @package templateSystem
* @copyright Copyright 2003-2011 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_featured.php 18698 2011-05-04 14:50:06Z wilt $
*/
$content = "";
$content .= '<div class="sideBoxContent centeredContent">';
$featured_box_counter = 0;
while (!$random_featured_product->EOF) {
$featured_box_counter++;
$featured_box_price = zen_get_products_display_price($random_featured_product->fields['products_id']);
$content .= "\n" . ' <div class="sideBoxContentItem">';
$content .= '<a href="' . zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' . $random_featured_product->fields["products_id"]) . '">' . zen_image(DIR_WS_IMAGES . $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= '<br />' . $random_featured_product->fields['products_name'] . '</a>';
$content .= '<div>' . $featured_box_price . '</div>';
$content .= '</div>';
$random_featured_product->MoveNextRandom();
}
$content .= '</div>' . "\n";
Would it be easier copy the contents of the includes/templates/template_default/sideboxes/tpl_best_sellers.php file (below), and edit it to show featured products instead? Then take that edited code and place it in the tpl_featured.php file (I have no idea how easy or hard this would be - apologies if it's a ridiculous idea!)
PHP 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 $
*/
$content = '';
$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
$content .= '<div class="wrapper">' . "\n" . '<ol>' . "\n";
for ($i=1; $i<=sizeof($bestsellers_list); $i++) {
$content .= '<li><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></li>' . "\n";
}
$content .= '</ol>' . "\n";
$content .= '</div>' . "\n";
$content .= '</div>';
?>
Thanks
Bookmarks