This is a discussion on products_new.tpl.php within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; Hi, Sorry, then I guess I do not understand/do not have a clue on what you are trying to ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#21
| ||||
| ||||
| Hi, Sorry, then I guess I do not understand/do not have a clue on what you are trying to do |
|
#22
| ||||
| ||||
| Quote:
My config on admin is to display the X latest products for the month. I did the changes from JohnW so it will just show the X latest products added, no matter what month they were added. But since I do not add products often, I thought it would be better to have them change a little bit, so I have changed it now so it will randomly display 6 products out of the 18 last ones added. Find the 2 following lines (they are close, but not toguether): 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);
$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); Find the following code: Code: if (($no_of_new_products = tep_db_num_rows($new_products_query)) > 0) {
while ($_new_products = tep_db_fetch_array($new_products_query)) {
$new_products[] = $_new_products;
$list_of_prdct_ids[] = $_new_products['products_id'];
} Quote:
Find the following code: Quote:
Quote:
note: the file to edit is /includes/modules/new_products.php |
| The Following User Says Thank You to MindTwist For This Useful Post: | ||
nefertari7 (10-12-2007) | ||
|
#23
| ||||
| ||||
| Here is another version to randomize the special products being shown on the main page. I also did it so it will take the latest 18 "special" products (hardcoded), and shown 3 random ones (configured on the admin section) Find: Code: $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS); Code: $specials_split = new splitPageResults($specials_query_raw, 18); Code: for ($x = 0; $x < $no_of_specials; $x++) { Code: shuffle($specials);
if ($no_of_specials > MAX_DISPLAY_SPECIAL_PRODUCTS) {
$no_of_specials = MAX_DISPLAY_SPECIAL_PRODUCTS;
}
for ($x = 0; $x < $no_of_specials; $x++) { Last edited by MindTwist; 10-12-2007 at 05:30 AM. |
| The Following 2 Users Say Thank You to MindTwist For This Useful Post: | ||
bkpie (12-22-2007), nefertari7 (10-12-2007) | ||
|
#24
| |||
| |||
| John's and Mindtwists fixes work as stated and now the month issue is gone via John's and it will randomly change the 3 new products on my homepage (3 set in admin)between 24 products(set in new_products.php) as in Mindtwists change. That is wonderful However when you click on the new products link from the homepage it shows all my over 1000 products 3 a page as per admin based on date added newest first. What would I change so it will only show the last 24 products added to my site based on date added. I have tried a couple things but they did not work. I know I am missing something easy. |
|
#25
| |||
| |||
| Quote:
Im 99.9% sure i have updated both files correctly, any idea where its gone wrong? |
|
#26
| |||
| |||
| Yes, you missed my first post which is post #2 on the thread. I didn't really have my act together that day and I had to post twice. Once you do that you'll be in good shape, but post if you have a problem.
__________________ John |
|
#27
| |||
| |||
| This works great for products_new and specials pages but how about the home page. Nothing changed on my homepage. We just launched site in May and come June no products displayed. Once I made changes noted here they show under new products but not on homepage. I tried on 2 sites with same results. No errors but no change...any additional info would be greatly appreciated. Scott |
|
#28
| ||||
| ||||
| Quote:
|
| The Following User Says Thank You to MindTwist For This Useful Post: | ||
idllc (06-02-2008) | ||
|
#29
| |||
| |||
| So when I change the code via post #2 and page 3 of this thread I should show products on the home page correct? It updated the new products page but not homepage. Demo So my site should be doing more than what it is showing now? Thanks for the fast reply by the way. Scott |
|
#30
| |||
| |||
| Quote:
Best wishes, Scott |
| 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 |