If this is your first visit, check our documentation. To post, register or login.
Forums / Community Contributed Add-Ons / Addon Sideboxes / Whats new sidebox to display 6 most recent items

Whats new sidebox to display 6 most recent items

Started by aaronjmorgan on 6 May 2014, 1:00 PM · Views: 1,505

Results 1 to 2 of 2
6 May 2014, 1:00 PM
#1
aaronjmorgan avatar

aaronjmorgan

New Zenner

Join Date:
Mar 2013
Posts:
48
Plugin Contributions:
0

Post #1 by aaronjmorgan

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?

6 May 2014, 6:02 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

Go to your Configuration ... Maximum Values ... and set the:

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?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!