osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

New Products Display

This is a discussion on New Products Display within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; I want to limit the number of new products displayed. Some months I may add 100 but may only want ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 11-22-2003, 12:14 PM
Member
 
Join Date: Sep 2003
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
warrenthewindmill
Default New Products Display

I want to limit the number of new products displayed. Some months I may add 100 but may only want to show 20 of them in the new products page.
I thought I had found the solution in new_products.php
Code:
if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
    $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_PRODUCTS_NEW);
  } else {
    $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_PRODUCTS_NEW);
  }
shouldn't 'limit' restrict the number of records returned to achieve what I want? If I change it in config all it does is change the number of products displayed on any one page, when I want to limit the number of records the SQL returns.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 11-22-2003, 03:45 PM
Member
 
Join Date: Sep 2003
Posts: 90
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Power: 0
warrenthewindmill
Default

Thought about this since I logged out. The SQL shown above is called every time a page is loaded and returns "n" records where n is MAX_DISPLAY_PRODUCTS_NEW. If I want to ensure I only get selected products then I guess the simplest solution is to run an update query to change the added date for the others to a month before the current one.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Display More New Products on Main Page HipHopServers osCMax v2 Features Discussion 4 12-12-2005 10:28 PM
No new products this month, but I want to display some anywa Willum osCMax v2 Installation issues 1 09-09-2005 06:46 AM
Display price in New Products for <Month> neil osCMax v1.7 Discussion 0 04-25-2005 09:39 PM
Stop Display of New Products Box - How To? gameparts osCommerce 2.2 Modification Help 4 12-08-2004 05:37 AM
Tax (U.K. VAT) display both byson osCommerce 2.2 Modification Help 0 03-28-2003 05:36 AM


All times are GMT -8. The time now is 03:59 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax