Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    11
    Plugin Contributions
    0

    Default why is there no maximum value setting for new products?

    I want my site to display only three of my newest products on the main page of my site but I cannot find a setting for this. It is there for featured products but not new. Why?

    I'd rather not have to manually make my new products featured just to be able to limit the number shown on my main page.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: why is there no maximum value setting for new products?

    That's rather odd... I guess the idea was that you would want to show all the products that fell under the "new" range. Since there is no admin setting, you could modify the code to make your desired maximum.
    In /includes/modules/your_template/new_products.php, find this around line 56:
    PHP Code:
    $num_products_count = ($new_products_query == '') ? $new_products->RecordCount();

    // show only when 1 or more 
    Add a line in there:

    if($num_products_count > 3) $num_products_count = 3;//2009-12-04
    PHP Code:
    $num_products_count = ($new_products_query == '') ? $new_products->RecordCount();
    if(
    $num_products_count 3$num_products_count 3;//2009-12-04
    // show only when 1 or more 

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: why is there no maximum value setting for new products?

    The above will only set the column width; to limit the display, you need another addition. Find this around line 73:
    PHP Code:
    $col ++; 
    and add after it

    if($col == ($num_products_count - 1) break;//2009-12-04
    PHP Code:
    $col ++;
    if(
    $col == ($num_products_count 1)) break;//2009-12-04 
    Note: this will only work if you have only one row of products displayed. If you have more rows, $col will never get high enough to trigger the break and all new products will display. More code will be needed for that case.
    Last edited by gjh42; 4 Dec 2009 at 05:38 PM.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: why is there no maximum value setting for new products?

    This should account for the total number of products displayed so far in cutting off the output:
    PHP Code:
    $col ++;
    if(
    $col == $num_products_count or ($row SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS $col == $num_products_count)) break;//2009-12-04 
    Only needed if you want more than one row of new products.

    Edit - $col has been incremented already, so the "-1" is not needed for any of these.
    PHP Code:
    $col ++;
    if(
    $col == $num_products_count) break;//2009-12-04 
    Last edited by gjh42; 4 Dec 2009 at 05:49 PM.

 

 

Similar Threads

  1. Why can I still see my products when after setting site down for maintenance?
    By ak6000 in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 19 Jun 2012, 03:40 AM
  2. Replies: 3
    Last Post: 17 Jan 2012, 08:20 AM
  3. Maximum Order Value or Max Products
    By Andy_GS in forum Managing Customers and Orders
    Replies: 5
    Last Post: 20 May 2009, 06:42 PM
  4. Maximum Value In Shopping Cart (New Module)
    By fairestcape in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Feb 2009, 05:25 PM

Posting Permissions

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