cancel
Showing results for 
Search instead for 
Did you mean: 

How to use a color for my Products

How to use a color for my Products

I have a product attribute dropdown field "color request" in which; option values are filled with hex value in text format. I want to use this field to pick the color according to the hex value. I dont want to use this as swatch, just need to filter the "color request"  that how many products are in which color requested with the filled color. I have made a hex colorpicker module for this but unable to use this module in product add / edit form. It is working well in system/configuration/general tab but unable to figure out how to use this module in product add/edit form. Any help please?

 

I have attached screen shots (highlighted in yellow) for reference.

screenshot 1

 

 

screenshot 2

 

10 REPLIES

Re: How to use a color for my Products

Hi susan5in7,

 

I'm very confused about your points here:

1. In product detail page, your color is dropdown box, but in your configuration is a text box => I think it should be a multi select. Values which are chosen will be available in your dropdown box in product detail.

 

2. You will use these values in Configuration for color values in Product Page admin?

 

If you agree with me about above ideas, I will write a module to solve your problems here.

Ideally, we will follow the ERD below:

 

Note: This model is not corrected, because product attributes base on EAV model. My model only shows my simple idea and it's easily for you to understand.

We will step by step to do this.

--In product detail page, we create an attribute hex_color.

--Then, we build a module to create a table example_hex_color  => its values are used for our configuration.

--Lastly, bulid a collection to get values from configuration to hex color in product detail page.

Problem solved? Click Accept as Solution!

Re: How to use a color for my Products

Hi mrkhoa99

Actually I have not stated clearly in my previous post. I have created an attribute which is type dropdown and options are hex color codes which I need to be filled automatically when I'll insert the hex code. I have attached the attribute screenshot. Is this possible? I am unable to figure it out how to use my colorpicker module as attribute.

 

Here are the screenshots of the attribbute

 

 

 

 

Re: How to use a color for my Products

Hello Susan5in7,

 

I think we will spend a lot of time on building this feature. This part isn't easy for us. I also want to heard from you the good thing about your module.

 

I have just done a module called example color, I hope it is useful for you.

https://www.dropbox.com/sh/lzotbixgm6anilt/AABG0NME9p8z4fcL87-uxoFua?dl=0

-After setting up this module into your Magento, you should find table example_hex_color, you insert some color values.

-You choose a product detail admin, in General tab, you find Hex Color , there are some color options.

-Find configuration: System -> Configuration -> Example Color.

 

Problem solved? Click Accept as Solution!

Re: How to use a color for my Products

Hi MrKhoa99,

 

I have just installed your module, but it is showing error after the click config>example color>color config options; "Fatal error: Call to a member function toOptionArray() on a non-object in .../..../..../app/code/core/Mage/Adminhtml/Block/System/Config/Form.php on line 463" . Have you any idea why is this?

 

 

 

Re: How to use a color for my Products

Hi Susan,

 

I have just updated, you try again. Sure that all files are copy to Magento folder.

Note: Model is important folder, the most important logic goes here. Our fatal error is related to model. 

Problem solved? Click Accept as Solution!

Re: How to use a color for my Products

I have downloaded from Dropbox with same link and installed but same message appears. Finding out the solution.

Re: How to use a color for my Products

Hi Susan,

 

Which's your Magento version?

Before installing my module again. You must delete three items:

1. Delete attribute hex_color

2. Delete table : example_hex_color

3. Find table core_resource => delete row example_color_setup <= very important because this makes our module installed again. If not, our module will not update new code lines.

 

After all, copy all files again. Make sure that all of them are copied.

 

Problem solved? Click Accept as Solution!

Re: How to use a color for my Products

Hi MrKhoa,

Done all the procedure but same problem.I am in Magento ver. 1.9.2.1. Have you tested it by yourself? Is it working?

Re: How to use a color for my Products

Hi Susan,

 

It works ok! I also tested it on my computer friend. My Skype: mrkhoa99, I will setup it.

Problem solved? Click Accept as Solution!