
Originally Posted by
allmart
Great Add-on!!
For the what's new scroller, what changes would have to be made to "tpl_whats_new_scrolling.php" to display the product description under the product name?
Thanks,
To make the change you're requesting, you'll need to change (at least) two files, adding the portions identified like this:
/includes/modules/sideboxes/YOUR_TEMPLATE/whats_new_scrolling.php:
Code:
// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2010 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$display_limit = zen_get_new_date_range();
$whats_new_scrolling_sql = "SELECT p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name, p.master_categories_id, pd.products_description
FROM (" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
WHERE p.products_id = pd.products_id
AND pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
AND p.products_status = 1 " . $display_limit;
$whats_new_scrolling = $db->ExecuteRandomMulti ($whats_new_scrolling_sql, MAX_RANDOM_SELECT_NEW);
if (!$whats_new_scrolling->EOF) {
require ($template->get_template_dir('tpl_whats_new_scrolling.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes') . '/tpl_whats_new_scrolling.php');
$title = BOX_HEADING_WHATS_NEW_SCROLLING;
$title_link = FILENAME_PRODUCTS_NEW;
require ($template->get_template_dir ($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default);
}
and then change the /includes/templates/YOUR_TEMPLATE/sideboxes/tpl_whats_new_scrolling.php to display that information:
Code:
// -----
// Scrolling "what's new" sidebox, based on the whats_new.php sidebox that's built into Zen Cart!
//
// Copyright (c) 2014, Vinos de Frutas Tropicales (lat9)
// Copyright 2003-2011 Zen Cart Development Team
// Copyright 2003 osCommerce
// License: http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
//
$content = '<div class="sideBoxContent centeredContent">';
while (!$whats_new_scrolling->EOF) {
$whats_new_price = zen_get_products_display_price ($whats_new_scrolling->fields['products_id']);
$content .= "\n" . ' <div class="sideBoxContentItem hiddenField whatsNewScroller">';
$content .= '<a href="' . zen_href_link (zen_get_info_page ($whats_new_scrolling->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev ($whats_new_scrolling->fields['master_categories_id']) . '&products_id=' . $whats_new_scrolling->fields['products_id']) . '">' . zen_image (DIR_WS_IMAGES . $whats_new_scrolling->fields['products_image'], $whats_new_scrolling->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);
$content .= '<br />' . $whats_new_scrolling->fields['products_name'] . '</a>';
$content .= '<div>' . zen_trunc_string (zen_clean_html ($whats_new_scrolling->fields['products_description'])) . '</div>';
$content .= '<div>' . $whats_new_price . '</div>';
$content .= '</div>';
$whats_new_scrolling->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.whatsNewScroller").cycle(10000);</script>' . "\n";
Bookmarks