osCmax v2.5 User Manual
Results 1 to 2 of 2

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 ...

      
  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    90
    Rep Power
    0


    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.

  2. #2
    Member
    Join Date
    Sep 2003
    Posts
    90
    Rep Power
    0


    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.

Similar Threads

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •