Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Randomize Featured Products......


robert74

Recommended Posts

I have looked all over this forum and i can't find the answer i'm looking for. I would like for my "featured products" to be randomized when someone goes to the homepage of my site.

 

any ideas?

 

 

 

 

-thanks in advance

Link to comment
Share on other sites

change the includes\modules\featured_sets.php where the code sets up the queries. Each of the products sql queries has the "order by" clause. You need to set it to random like

 

order by rand()

Link to comment
Share on other sites

change the includes\modules\featured_sets.php where the code sets up the queries. Each of the products sql queries has the "order by" clause. You need to set it to random like

 

order by rand()

 

Thank you :D Thank you :D Thank you :D

Link to comment
Share on other sites

Thank you :D Thank you :D Thank you :D

 

Ok, i was a bit premature with my thank yous.....i don't have a "featured_sets" in my modules. I have new products, product listing, and upcoming products

Link to comment
Share on other sites

I see I thought you were using that contribution. For the default osc store in catalog\includes\modules\new_products.php

 

you should have some code that looks like

order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

so replace it with

order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

there should be 2 instances.

Link to comment
Share on other sites

I see I thought you were using that contribution. For the default osc store in catalog\includes\modules\new_products.php

 

you should have some code that looks like

order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

so replace it with

order by rand() limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

there should be 2 instances.

I reinstate my "thank you's"

Link to comment
Share on other sites

Further to Enigma's answer, the Featured Products contribution comes with this feature already installed. You set your Featured Products in the Admin Tool (say 20 items) and then set how many products you want to display (say 8) and it displays 8 random products from your selection of 20 on the homepage each time someone visits your store.

 

http://www.oscommerce.com/community/contributions,651

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...