<?php
/**
 *\licence GPL 2005-2010  The osCSS developers - osCSS Open Source E-commerce
 *\portion code Copyright (c) 2002 osCommerce
 *\package osCSS-2 <www http://www.oscss.org>
 *\version 2.1.0
 *\date  28/11/10, 22:44
 *\author oscim <mail aurelien@oscim.fr> <www http://www.oscim.fr>
 *\encode UTF-8
 *\group boxes
 *\file whats_new.php
 *\dir includes/boxes/
 *\brief boite nouveauté
 *
 *		Affichage de la boite des nouveautés, qui assure l'affichage d'une seul produit.
*/
global $random_product, $price;
if ($random_product = tep_random_select("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c  where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p.products_status = '1' and c.categories_status = '1' and p.products_date_added > SUBDATE(now(), INTERVAL  ".(int)MAX_DATEADDED_FOR_NEWX_PRODUCT." DAY)  order by p.products_date_added desc limit " . $page->_conf_value('MAX_RANDOM_SELECT_NEW'))) {
  $product_obj=product::get_item($random_product['products_id']);
  $s='';
  $random_product['products_name'] = $product_obj->products_name;
  $random_product['products_image'] =$product_obj->products_image;
  $random_product['specials_new_products_price'] = $price->print_products_price($random_product['products_id']);

  $array= array('title'=>__('box heading whats new'),'content'=>tep_output_string_protected(tep_get_include_contents('box.whats_new'),false,true));
}
else $array= array('title'=>'','content'=>'');
?>