Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I change the default image based on the color option?


vmtent

Recommended Posts

Ok, as a n00b I have been plugging away & my site is coming along, but I cannot find a thread that decribes how you can change the default product image based on what color is picked. Example, I sell a shirt style that is offered in 3 or 4 different colors. If the default image of the shirt is green & the customer chooses the red color option, how can I make the image change to a pic of the red shirt? :'(

 

I have tried to do my best to do a search on this, but I am striking out so far. Anyone know the solution? Thanx in advance!

Link to comment
Share on other sites

One way to accomplish this functionality is to use a Javascript that sets the image based upon the color that is selected within a drop-down menu.

 

When the color is changed in the drop-down menu have the Javascript function run (i.e. onChange event).

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Has anyone else done this on their site? I know nothing about Java, but I can cut & paste with the best of them! ;) Is there a contribution that does this? I haven't been able to find anything yet. :-"

Link to comment
Share on other sites

I would imagine that there is already a JavaScript available that provides this functionality but I have no idea where you would find it.

 

Also, there is a *huge* difference between Java and JavaScript so please be sure to use the correct name and do not use them interchangeably.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...