Post by slingeraap » Fri Nov 23, 2012 10:59 pm

Hello,

I have added a field to the oc_option_value table, named 'hexcolor' which is a varchar of 6 characters. This way I don't have to use the 'image' field (which is not used at all in OpenCart) but now i can easily display those colors via the hexcode, at least, if that entry is not left blanc.

My question is, how do i add this field the best way to the CMS? I have never written my own module or extension but i would like to try it if neccesary. Or do i just have to text-edit the pages? But then i can't do updates anymore i guess...

New member

Posts

Joined
Sun Dec 05, 2010 7:02 pm

Post by Avvici » Mon Nov 26, 2012 2:13 am

First, the image field "is" used for the option type IMAGE. Yes, I will admit it makes 0 sense why some of the other Option Types don't even have working images on the front end but allow you to place the images on the back end. But, I just wanted to clarify that the field "is" used.

FYI if you want to store a HEX CODE:
Use Varchar 6 if you plan on concatenating the '#' to the string after SELECTING it later on. (FFFFFF)
Use Varchar 7 if you plan on concatenating the '#' to the code upon INSERT. (#FFFFFF)

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by slingeraap » Fri Nov 30, 2012 10:36 pm

Thanks, i wandered where the image field was used. But i don't replace that field, i did add an extra field for the hex color code. And yes, i do put the # to the string myself. :-)

But my question is: What is the best way to integrate that extra field in the CMS? So that when there is an update of OC, it stays there and won't be overwritten. Do i have to make a module or extension? Or just write it in the right admin part (again be each update of OC)?

New member

Posts

Joined
Sun Dec 05, 2010 7:02 pm
Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot] and 103 guests