fraro Posted February 24, 2003 Share Posted February 24, 2003 I wonder how many days/weeks/moths is a product new? //// Fredrik Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2003 Share Posted February 24, 2003 As long as you dont add any ! HTH Link to comment Share on other sites More sharing options...
fraro Posted February 24, 2003 Author Share Posted February 24, 2003 What? But is every product new when I add a new product? Can someone answer this: I add a new produkt 01/01/2003 When does it stop showing in "New Products Window"? Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2003 Share Posted February 24, 2003 Like i said, if you dont add any new products the one that you have there will stay there .... but i think there is a contribution to alternate your new products HTH Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2003 Share Posted February 24, 2003 Hi, You will have to edit these pages so just the new products for that month show up. This was added: and month(p.products_date_added) = month(now()) Editing /catalog/products_new.php removes the extra products from the products_new.php page after clicking on the What's New? arrow. Line 56 $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' and month(p.products_date_added) = month(now()) order by p.products_date_added DESC, pd.products_name"; 2. Line (20-21) only in includes/modules/new_products.php Editing includes/modules/new_products.php removes the extra new products from the new products box on the default.php page. 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' and month(p.products_date_added) = month(now()) order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); Hope this helps! Link to comment Share on other sites More sharing options...
Epic Mike Posted January 7, 2006 Share Posted January 7, 2006 Just wanted to say that I spent alot of time searching for the answer to this question and even tried a contribution to no avail, but what modom said to try worked beautifully. Since my store is new and every product was added within 3 days of each other, I just used phpmyadmin to change the dates on products I didn't want to be "new" at first. Thanks for the help! So if you're trying to find out how to limit the number of new products in products_new.php or new_products.php, give this one a shot. Link to comment Share on other sites More sharing options...
digicammad Posted December 20, 2007 Share Posted December 20, 2007 Just to add to this. Rather than just showing products added this month you could show those added in the last x days, as follows: Replace month(p.products_date_added) = month(now()) with datediff(now(),p.products_date_added) < 31 to show products added in the last 31 days. HTH Ian Link to comment Share on other sites More sharing options...
digicammad Posted December 20, 2007 Share Posted December 20, 2007 Hmmm, on further testing it seems as if datediff support doesn't go back very far, so use the following snippet instead: (to_days(now()) - to_days(p.products_date_added)) < 31 HTH Ian Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.