Jump to content

[SOLVED] Display color name under color picker box?


venom2506

Recommended Posts

Hello, I'm in need of some help again. I am now required to have the name of the color attributes show under their boxes (like, under a box with the color yellow, it shows the name I've chosen in the back office, the same that already appears in the tooltip).

Could someone give me pointers as for how to do that? I already have an inkling of where it should go, in product.tpl, in there:

<li><a id="color_{$id_attribute|intval}" class="color_pick" style="background: {$color.value};" onclick="updateColorSelect({$id_attribute|intval});$('#wrapResetImages').show('slow');" title="{$color.name}">{if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}<img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$color.name}" width="20" height="20" />{/if}</a></li> 

and I should use "$color.name" as the variable to display said name, but the syntax kinds of elude me, so any help would be welcome.

 

Thank you very much.

Edited by venom2506 (see edit history)
Link to comment
Share on other sites

Mmh, my job's firewall blocking the picture. I'll check it at home tonight, thank you. For the time being, unfortunately, this didn't work either. Should it go in a php tag or something? Well, I tried in a php tag and it didn't work, so my question is kindda pointless :/

 Well I attached my tpl file, it's been modified a bit, if you have the time to check it, maybe there's something in there that prevents the change.

product.txt

Edited by venom2506 (see edit history)
Link to comment
Share on other sites

  • 3 months later...
  • 6 months later...

Anybody knows how to make it display the color name next to "Color" when you click on the square? I agree with the comment above that it would make more sense to display the color name only when it's picked. Plus it would look better than the mod above.

This is an important feature considering that there are so many dark shades (black, dark brown, dark gray, etc) that you won't be able to see the difference if the monitor settings are low.

 

---

PS 1.6.0.9

Edited by aliaspt (see edit history)
Link to comment
Share on other sites

  • 1 year later...

Anybody knows how to make it display the color name next to "Color" when you click on the square? I agree with the comment above that it would make more sense to display the color name only when it's picked. Plus it would look better than the mod above.

This is an important feature considering that there are so many dark shades (black, dark brown, dark gray, etc) that you won't be able to see the difference if the monitor settings are low.

 

---

PS 1.6.0.9

 

Hey Aliaspt,

Can you please explain to me how? I'm not finding it so easy.

 

Merry Christmas

 

// Morten 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

Hi have you solved it? if yes please tell me how i want to do same :)

 

Anybody knows how to make it display the color name next to "Color" when you click on the square? I agree with the comment above that it would make more sense to display the color name only when it's picked. Plus it would look better than the mod above.

This is an important feature considering that there are so many dark shades (black, dark brown, dark gray, etc) that you won't be able to see the difference if the monitor settings are low.

 

---

PS 1.6.0.9

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...