Whats new sidebox to display 6 most recent items
Just wondering how to get the whats new sidebox to display the 6 most recent items added to my store?
This is the link to my site : https://www.toyzeum.com/store/
the sidebox displays old items ive added but not in the order of the most recent added.... and for some reason it only displays 3 products instead of 6 products. Can anyone tell what is wrong within the script?
the code I am using as follows:
"<?php
/**
* whats_new sidebox - displays a random "new" product
*
* @package templateSystem
* @copyright Copyright 2003-2010 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: whats_new.php 15880 2010-04-11 16:24:30Z wilt $
*/
// display limits
// $display_limit = zen_get_products_new_timelimit();
// $display_limit = zen_get_new_date_range();
$orderBy = 'order by p.products_date_added desc LIMIT 0 , 6';
$random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added, p.products_price, pd.products_name,
p.master_categories_id
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 " . $orderBy;
// $random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);
$random_whats_new_sidebox_product = $db->ExecuteRandomMulti($random_whats_new_sidebox_product_query, MAX_RANDOM_SELECT_NEW);
if ($random_whats_new_sidebox_product->RecordCount() > 0 ) {
require($template->get_template_dir('tpl_whats_new.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new.php');
$title = BOX_HEADING_WHATS_NEW;
$title_link = FILENAME_PRODUCTS_NEW;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);"
the sidebox displays old items ive added but not in the order of the most recent added.... and for some reason it only displays 3 products instead of 6 products. Can anyone tell what is wrong within the script?
Re: Whats new sidebox to display 6 most recent items
Go to your Configuration ... Maximum Values ... and set the:
Quote:
Random New Products for SideBox
Number of random NEW products to rotate in the sidebox
Enter the number of products to display in this sidebox at one time.
How many products do you want to display in this sidebox?