Yes, you can have multiple CSS files. Though most people may get away with the other method in this thread and just use images.
Here's an example in my product.tpl:
I show a manufactures logo. But, as I do not want to call the logo from the MySQL table and php, I use a Smarty variable replacement.
Code:
[img]{$ImagesDir}/brands/{$product.manufacturer|replace:' ':''}.gif[/img]
If I put an image in the skin1/images dir and in a folder called "brands", I could then call the images with a Smarty variable. But, some brands (and colors) would have multiple words. So I tweak the variable to replace "spaces" with no space. That's the
|replace:' ':'' part of the code.
Using the other solution in this thread, you could then also use the "Product Option" itself to show an image with it's name. Easier than CSS if you only have a few brands or charts to display, but CSS works well if you have a lot of brands with a lot of color variations. Say I have 130 brands with 50 diff. color charts. It might only work to use the CSS technique and if statement method as you have done.
That way, you only get the core CSS skin1 file AND the one manufacturers CSS file for the color calls... a lot less code than calling all CSS files into the template structure. And as I mentioned a decent entry-level alternative vs. php and MySQL work which would be necessary if you actually wanted to assign a swatch image to the variant table. X-Cart did this for a site I know, but it was a bit complex and a few hundred dollar job. I'm sure they have the code for many specific needs.
- Mike