Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do i do this?


Guest

Recommended Posts

Posted

firstly i want to remove the whats new box, which is fairly simple.

 

then i want to list my products on my home page so that everytime i refresh the page diffent products from different categories appear.

 

like this site for example:

 

 

www.eclipsecomputers.com

Posted

Hi,

 

If you want to randomize the new_products.php file do the following:

 

In catalog/includes/modules/new_products.php find the following:

 

$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' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

AND CHANGE TO:

 

$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' order by RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

Also find the following in the same file:

 

$new_products_query = tep_db_query("select distinct 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, " . 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);

 

AND CHANGE TO:

 

$new_products_query = tep_db_query("select distinct 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, " . 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 RAND() limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

The only changes to the above is:

 

FROM:

order by p.products_date_added desc limit

 

TO:

order by RAND() limit

 

Hope that helps,

StrictlyPC

Posted

ok thanks for that about randomising my new products, but i want to go further than that.

 

what i want is have my products randomise on my homepage.

 

say i show 8 products on my home page, the next time i refresh the products a different 8 will appear.

 

i want to completely remove the "whats new" box.

 

any ideas?

Posted

Hi,

 

 

I don't understand what you mean by moving all your products to the home page. It will only randomize your new products so that everytime you refresh, the products listed on your new_products box will be different.

 

StrictlyPC

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...