Full service web hosting, great prices and support. Starts at $1.99/month!
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: products_new.tpl.php

  1. #1
    dead7
    Guest


    Default products_new.tpl.php

    I have a question about the file products_new.tpl.php.

    I see that oscmax does new product listings by active month in the index_nested.tpl.php -- How can I change that so it just shows all new products in that particular category? I don't want it to be month specific.

    Rarely do we add products monthly, but we do like this feature so it fills in the nested index.php pages a little better.

    Just want to remove the month specifics on it and just have it show new products for that category is all.. no date restrictions on when a product had to be added to show up.

    Thanks

  2. #2
    JohnW
    Guest


    Default Re: products_new.tpl.php

    I agree using the month to base the new products is a bad idea. It's really a problem when you haven't added products for the current month so it pulls from lasts year's month. Freaked me out first time I saw that.

    Anyway, look around line 16 for
    Code:
      $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and month(p.products_date_added) = month(now()) order by p.products_date_added DESC, pd.products_name";
    and change it to this
    Code:
      $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and (p.products_date_added) order by p.products_date_added DESC, pd.products_name";

  3. #3
    dead7
    Guest


    Default Re: products_new.tpl.php

    Oddly enough I did try messing with that only a bit differently than you listed above.. It doesn't seem to work any which way I edit it though Any other ideas?

  4. #4
    JohnW
    Guest


    Default Re: products_new.tpl.php

    Oops, there is another file I forgot about. In includes/modules/new_products.php look around line 26
    Code:
        $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p where products_status = '1' and month(p.products_date_added) = month(now()) order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
    Change to
    Code:
        $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price from " . TABLE_PRODUCTS . " p where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
    And around line 29
    Code:
        $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price 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 c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and month(p.products_date_added) = month(now()) order by p.products_date_added desc limit ". MAX_DISPLAY_NEW_PRODUCTS);
    Change to
    Code:
        $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_price as products_price 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 c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

  5. #5
    dead7
    Guest


    Default Re: products_new.tpl.php

    Perfect,

    Michael.. worth a sticky here!

  6. #6
    osCMax Developer


    products_new.tpl.php

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,013
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    594


    Default Re: products_new.tpl.php

    Make sure to click the Thanks! button on one of John's posts dead7.
    Michael Sasek

    osCmax 2.5.4 is now available via auto-installation using Softaculous!

    Stay Up To Date with everything osCMax:
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    dead7
    Guest


    Default Re: products_new.tpl.php

    Quote Originally Posted by michael_s View Post
    Make sure to click the Thanks! button on one of John's posts dead7.
    Fair enough. but man, I can't stand that vbulletin hack

  8. #8
    osCMax Developer


    products_new.tpl.php

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,013
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    594


    Default Re: products_new.tpl.php

    Why do you hate it? I love it. Keeps the forum clear of all those thousands of Thank you posts. I delete about a dozen posts a day that simply say "thanks" or some version of thanks.

    I hate em... It really clutters the forums when there are ten thank you posts for every legitimate post. Thank you posts are as bad as spam for a forum administrator...

    The Thank you hack is great as it accomplishes 2 things that we need here. It gets rid of the need to post a thank you post and saves you the time of having to reply if all you want to do is say thanks. Just click the thanks button. And it awards reputation to whomever you thank, allowing them to build credibility and rank here at the community.
    Michael Sasek

    osCmax 2.5.4 is now available via auto-installation using Softaculous!

    Stay Up To Date with everything osCMax:
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  9. #9
    ZacFields
    Guest


    Default Re: products_new.tpl.php

    I'm not sure if this is related or not, but does anyone know how I can make it so that more than just 3 of the "new products" shows up on the index page?

    I'd like to change it to more like 6 or 9

    Zac

  10. #10
    JohnW
    Guest


    Default Re: products_new.tpl.php

    Yes, that is done in the Admin Panel under configuration. Actually, it's really worth your time to go through the Admin panel line by line as it controls quite a bit.

Page 1 of 4 123 ... LastLast

Similar Threads

  1. limiting products properly in products_new
    By ganz_friedrich in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 06-10-2005, 04:48 AM

Bookmarks

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
  •