Getting Smarter Slowly Posted November 6, 2010 Posted November 6, 2010 How to clear "What's New" or "New Products" I loaded all the products in the store and now it stays on this section all the time. It isn't actually "new items". Is there a way to clear that or is there a time frame that I have to wait & then add another product - say...next month? I certainly don't want that to stay that way. You're never too old to learn. Even an old fart like myself loves learn and be creative. ?>if (empty($coffee)) {$coffee=new coffee();}<?
a.forever Posted November 7, 2010 Posted November 7, 2010 How to clear "What's New" or "New Products" I loaded all the products in the store and now it stays on this section all the time. It isn't actually "new items". Is there a way to clear that or is there a time frame that I have to wait & then add another product - say...next month? I certainly don't want that to stay that way. Here's code that I found a long time ago that sets a timeframe. Props to whomever made the code. I just wish I could find the post/add-on again so I could just link it. In catalog/products_new.php: FIND: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); REPLACE WITH: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); $ndate = strtotime("-60 days"); // set max age of displayed product $ndate = strftime("%Y-%m-%d",$ndate); FIND: $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 . "' order by p.products_date_added DESC, pd.products_name"; REPLACE WITH: $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 p.products_date_added > '".$ndate."' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; Configure 60 to however many days you want. You can also use EasyPopulate to change the date for multiple products simultaneously.
Getting Smarter Slowly Posted November 7, 2010 Author Posted November 7, 2010 I'll tell you in 10 days if it works! Thanks a bunch! You're never too old to learn. Even an old fart like myself loves learn and be creative. ?>if (empty($coffee)) {$coffee=new coffee();}<?
satish Posted November 8, 2010 Posted November 8, 2010 <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> replace with <td><? //php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> on index.php Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
♥14steve14 Posted November 8, 2010 Posted November 8, 2010 I had been looking for a solution to do the same for a long time and now i have found it. Satish If i use your method my box wont show when i do add new products. REMEMBER BACKUP, BACKUP AND BACKUP
burt Posted November 8, 2010 Posted November 8, 2010 Another way; $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, 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_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 > date_sub(NOW(), INTERVAL 1 MONTH) order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); php.net/date_sub dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add to see the INTERVALs you can use.
tigergirl Posted November 8, 2010 Posted November 8, 2010 I just wish I could find the post/add-on again so I could just link it. I think it was by Spooks limiting age of new products - it worked for me. I'm feeling lucky today......maybe someone will answer my post! I do try and answer a simple post when I can just to give something back. ------------------------------------------------ PM me? - I'm not for hire
burt Posted November 9, 2010 Posted November 9, 2010 Spooks way is incorrect and buggy, and a.forever has reposted it :( That does not give you 60 days in all cases. It might give you 59 or 61 - which *could* be important to some shopowners.
satish Posted November 9, 2010 Posted November 9, 2010 @How to clear "What's New" or "New Products" I loaded all the products in the store and now it stays on this section all the time. It isn't actually "new items". Is there a way to clear that or is there a time frame that I have to wait & then add another product - say...next month? I certainly don't want that to stay that way. I assume that you do not want to display this box on home page. if that what you want then( this is just clarification of my previous reply) search for this line in index.php <td><?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> and replace with <td><? //php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?></td> on index.php Satish Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does.
Getting Smarter Slowly Posted November 9, 2010 Author Posted November 9, 2010 I assume that you do not want to display this box on home page. Actually I managed to delete that table on the home page some time ago. I am using the time stamp system as described above. It isn't crucial as far as the amount of days or exact time. I reset it for 10 days just to get rid of the entire stock. Today is 11/9/2010 & it already kicked out the stock on that page & it says "There are currently no new products". However, the "What's new" box on the column is still there and changes products - which is kewl! This is exactly what I was looking for. My link You're never too old to learn. Even an old fart like myself loves learn and be creative. ?>if (empty($coffee)) {$coffee=new coffee();}<?
a.forever Posted November 12, 2010 Posted November 12, 2010 Spooks way is incorrect and buggy, and a.forever has reposted it :( That does not give you 60 days in all cases. It might give you 59 or 61 - which *could* be important to some shopowners. ...True..true <_<
mailey1974 Posted March 26, 2012 Posted March 26, 2012 Here's code that I found a long time ago that sets a timeframe. Props to whomever made the code. I just wish I could find the post/add-on again so I could just link it. In catalog/products_new.php: FIND: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); REPLACE WITH: $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW)); $ndate = strtotime("-60 days"); // set max age of displayed product $ndate = strftime("%Y-%m-%d",$ndate); FIND: $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 . "' order by p.products_date_added DESC, pd.products_name"; REPLACE WITH: $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 p.products_date_added > '".$ndate."' and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name"; Configure 60 to however many days you want. You can also use EasyPopulate to change the date for multiple products simultaneously. But where is the catalog/products_php located at?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.