| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Auto-Generated Color or Image Swatches from Product Options | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
![]() Switch the product image on click of color swatch
Just worked this to take advantage of ianwebster's brilliant "Product Options and Image previews" mod. Now, the swatches change the product image and it looks and work great. But, first implement his mod in both user and admin. Then you can manually add or insert the table variantid's so that both the variant dropdown AND the color swatches can change the product image. Here's the main section: Code:
Next, I'll work the names to do the swap onclick as well... getting there. - Mike
__________________
4.1.9 |
|||||||
#12
|
|||||||
|
|||||||
![]() Quote:
Hello Mike, Have you tried to disable some? Because I've tried your code has is, and you do get holes for the missing disabled options. See images below. Mine is above and yours is below. Colors don't apears for the avaible options because I didn't create the css for it but we can still see the names of the options. http://www.tmdesign.ca/color/swatch.jpg disabled in redhttp://www.tmdesign.ca/color/swatch003.jpghttp://www.tmdesign.ca/color/swatch2.jpg It must be the way we're building the table. We're close to the solution. Be back soon. Martin
__________________
x-cart gold 4.0.15 |
|||||||
#13
|
|||||||
|
|||||||
![]() Solution to use images without CSS !
Hello Mike and ETI Good news I've got it! If you want to use images without css you can use this code. Any number of column, options disabled or not, and the table containing the swatch is now close correctly. Code:
It might not be the cleanest code but it works. Feel free to improve it. Martin
__________________
x-cart gold 4.0.15 |
|||||||
#14
|
|||||||
|
|||||||
![]() Matrin,
Yes, I see what you mean. But, though you meant disabled options. If you disable an option it doesn't show in the dropdown nor in the swatch array. But, if you hav an option with no CSS (image or hex code in CSS) then the TD is empty. This is normal behaviour as we need swatched to display for all available options that are variants. Thus, works well. My current issue, is to get the name to make the product image change when clicked... like the swatch. Thanks for your contribution to this work in progress. - Mike
__________________
4.1.9 |
|||||||
#15
|
|||||||
|
|||||||
![]() Could some of you post links to your sites where you're using this so we can see?
Thanks!
__________________
Danielle X-Cart Pro 4.0.10 X-Gift-Registry X-AOM |
|||||||
#16
|
|||||||
|
|||||||
![]() Hi Danielle,
Unfortunately the site isn't available to public yet. But for now here's a picture. http://tmdesign.ca/color/swatch006.jpg The swatch shows the 11 curently available colors out of the 15. I wrote a modifier to split the value of each options to call the picture and put a description underneat.
__________________
x-cart gold 4.0.15 |
|||||||
#17
|
|||||||
|
|||||||
![]() OK, so this will look the same as if I had an options dropdown box and then detailed images, except that the images will actually be associated with the options in the box, and will be labelled with the option name as well, is that right?
__________________
Danielle X-Cart Pro 4.0.10 X-Gift-Registry X-AOM |
|||||||
#18
|
|||||||
|
|||||||
![]() Quote:
Close, ![]() I still have detailed images associated to the product. But for the rest of it you right.
__________________
x-cart gold 4.0.15 |
|||||||
#19
|
|||||||
|
|||||||
![]() Oh OK, so I could still have detailed images below the swatches then if I wanted?
__________________
Danielle X-Cart Pro 4.0.10 X-Gift-Registry X-AOM |
|||||||
#20
|
|||||||
|
|||||||
![]() Exactly.
![]()
__________________
x-cart gold 4.0.15 |
|||||||
|
|||
X-Cart forums © 2001-2020
|