View Single Post
  #2  
Old 01-25-2008, 10:05 AM
  SpinyMan's Avatar 
SpinyMan SpinyMan is offline
 

Advanced Member
  
Join Date: Jan 2008
Posts: 30
 

Default Re: Limiting the number of featured products displayed and randomising

Quote:
Originally Posted by wardworth
I would like to limit the number of featured products displayed on a subcategory and then randomise this limit so that different featured products (from that category) are displayed per refresh.

For example, I would like only 6 featured products to show but have a different 6 featured products displaying on each refresh.

Any ideas?

Hi,

open "featured_products.php" and add 2 lines of code
Quote:
$search_data["products"]["sort_condition"] = "RAND() DESC";
$objects_per_page = 6;
before a line
Quote:
$REQUEST_METHOD = "GET";

it will show 6 random products with the pages to other featured products (if more exists).
If this variant doesn't meen your wish try this one:

put this code
Quote:
shuffle($products);
array_splice($products,6);
before this line:
Quote:
$smarty->assign("f_products",$products);
__________________
Regards,
SpinyMan

X-Cart Templates Store -
http://www.x-cart-customization.com/shop/

X-Cart Customization Services -
http://www.x-cart-customization.com/
Reply With Quote