Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Random_products on the main page?!


Tquesnel

Recommended Posts

OK, on the column_left.php there is a calling for whats_new.php.. and everytime you hit reload, a new picture is displayed there randomly.. in the code there is a $random_products code which is fine.. but I'd like to have this same effect on my main page for new products. I may add 10 new products per month, but only set my max products to 3 to allow room for other things...

 

I think i could just copy the code myself, but i can already foresee one major problem... it might randomly spawn the same products next to eachother. So I need some sort of code that only allows each following position to randomly pic from images that aren't in the previous locations.. not sure how to do that and wondered if there was a contrib for that.

Link to comment
Share on other sites

I'm not sure if this would workbut Linda McGrath uses this SQL query option to display the products randomly:

 

order by rand() DESC limit 6;

 

 

Try adding that at the end of your products query. Let me know if it works.

 

If not, you can try Linda McGrath's SECv2.2 contribution that includes most-used contributions for an OSC site. It's located at her website at http://www.thewebmakerscorner.com/freecall...products_id=130

 

 

hope this helps.

 

-Kurt

Link to comment
Share on other sites

oh.. yea thats the problem..i have sec 2.2. installed it on a brand new database... but this feature isn't in there, at least not for New Products.. it does randomize, or at least rotate, for product_specials.php but not new_products.php

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...