This is a discussion on products_new.tpl.php within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; I have a question about the file products_new.tpl.php. I see that oscmax does new product listings by active ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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 |
| The Following User Says Thank You to dead7 For This Useful Post: | ||
zuqaili (03-30-2007) | ||
|
#2
| |||
| |||
| 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"; 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";
__________________ John |
| The Following User Says Thank You to JohnW For This Useful Post: | ||
jmdesign (02-11-2007) | ||
|
#3
| |||
| |||
| 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 |
|
#4
| |||
| |||
| 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); 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); 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); 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);
__________________ John |
|
#5
| |||
| |||
| Perfect, Michael.. worth a sticky here! |
|
#6
| ||||
| ||||
| Make sure to click the Thanks! button on one of John's posts dead7.
__________________ Michael Sasek osCMax Developer osCMax Templates - Hundreds of premium quality templates. New designs every month! xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. |
|
#7
| |||
| |||
| Quote:
|
|
#8
| ||||
| ||||
| 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 Developer osCMax Templates - Hundreds of premium quality templates. New designs every month! xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host. |
|
#9
| |||
| |||
| 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
| |||
| |||
| 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.
__________________ John |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| limiting products properly in products_new | ganz_friedrich | osCommerce 2.2 Modification Help | 0 | 06-10-2005 04:48 AM |