Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to rotate products in New Products Module


marex99

Recommended Posts

In the first page there is a module New Products For June and there are last 9 items that was added to catalog. And always it is the same models.

Is it possible to rotate the last 100 items? Like in the box What's New?

 

Help please...

:rolleyes:

Link to comment
Share on other sites

In the first page there is a module New Products For June and there are last 9 items that was added to catalog. And always it is the same models.

Is it possible to rotate the last 100 items? Like in the box What's New?

 

Help please...

:rolleyes:

I know of 2 ways to change what shows in the box.

1 Hard way: go into the database and change the date you added a product to the catalog. This will change which item appears.

 

2 Easy way: install the Featured products contribution. Add the products you want to the mod and it automatically rotates them.

 

Tim

Link to comment
Share on other sites

catalog/includes/modules/new_products.php

 

	$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);
 } else {
$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);

 

change to order by p.products_date_added desc to rand()

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

so how it must look? like:

 

from

order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS

 

change to

order by p.products_date_added desc rand() " . MAX_DISPLAY_NEW_PRODUCTS

 

???

 

 

 

 

catalog/includes/modules/new_products.php

 

	$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);
 } else {
$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);

 

change to order by p.products_date_added desc to rand()

Link to comment
Share on other sites

change the bit of code

order by p.products_date_added desc

so as to read

order by rand()

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...