4 replies [Last post]
milerosu's picture
Offline
Joined: 09/15/2009
Juice: 10
Was this information Helpful?

Hello,

Is there a way to use the colorpicker cck field as an attribute for a product? Is there any other recommended way to allow buyers to pick a desired color for a product ?

Thanks a lot!

univate@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 03/27/2009
Juice: 465
Re: Colorpicker field as attribute

No attributes are not built using cck fields, so you are limited to the field types that are avilable in ubercart. Its an interesting idea and will probably be something that could be explode when ubercart moved to D7 which has the new field api.

You can add a blank text field as an attribute and with a little jquery you could add a color picker to that form item so it returns you a RGB number.

I'm curious as to what type of product are you selling that you wan to be able to pick from that many colors? The main use of picking colors is when you have 6 different colors of shirt and just specify each one and have them in a drop down list.

milerosu's picture
Offline
Joined: 09/15/2009
Juice: 10
Re: Re: Colorpicker field as attribute

Thank you, I have searched as you advised and found a possible solution here. Still, the drupal cck colorpicker looks more usable to me. I will "merge" them Smiling

The store is selling custom gift boxes, on which the font color and background of the label can be picked.

univate@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 03/27/2009
Juice: 465
Re: Re: Re: Colorpicker field as attribute

The colorpicker module has a form element type for adding color pickers to forms using the form api, so you could do exactly as the example you linked to and use a hook_form_alter() function to change an attributes field from a textfield to the colorpicker element.

Summit_drupal's picture
Offline
Joined: 12/11/2010
Juice: 137
Could you build a module of it please

Hi,
I saw this post, and would like to have the same as you with using cck color picker as color attribute (http://drupal.org/project/uc_attribute_cck)?

I have a solution (it will cost me 20 euro), using native color attribute (http://www.ubercart.org/project/uc_color_attribute), see for solution: http://dev.luketarplin.com/node/2
Would this be possible using cck fields?

greetings, Martijn