Post by sakathecheetah » Fri Jul 04, 2008 4:43 am

I wanted to know how difficult it might be to change the Option and Category length limits. I suppose it was done because of the way the default template spaces the names, but I have need of slightly longer options on my current project because of evil-but-precise medical jargon, and cannot abbreviate or shorten.

At any rate, I didn't see any options for changing this number (3-32 characters), so I assume it's declared arbitrarily somewhere in the code. I really hope it's not limited in the sql to 32 characters.... If anyone knows where I might make changes to these limits in the code, I would much appreciate it.

New member

Posts

Joined
Wed Jul 02, 2008 8:50 am

Post by frame » Fri Jul 04, 2008 4:55 am

As far as I know you have to edit the database and the code as well.
A little help:

Code: Select all

http://forum.opencart.com/index.php/topic,524.msg5320.html#msg5320

New member

Posts

Joined
Sat Apr 26, 2008 7:24 pm

Post by bruce » Fri Jul 04, 2008 6:38 am

Have a look through the database structure and change the description/title/name fields to text. It has unlimited storage and does not take any more space than varchar in mysql until you get to 255 characters.  http://dev.mysql.com/doc/refman/5.0/en/ ... ments.html

Then modify the function validate() in the admin controllers for category and product and any others you want bigger.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by sakathecheetah » Fri Jul 04, 2008 12:31 pm

Thanks for the help and quick replies. I'll give this a try in a couple days when I rebuild my default test store. So the tables that hold the category and option names are indeed char(32)? I really need to brush up on MySQL....

Thanks for pointing me to validate(). I'm probably going to go with VARCHAR for the entries, though, since that's what I was planning to do anyway (TEXT is overkill here and is generally slower on read). I really like where OpenCart is heading, so I'll try to do my part to help it along as well; I'll be ranting in the feature request section, soon. ;)

New member

Posts

Joined
Wed Jul 02, 2008 8:50 am

Post by bruce » Fri Jul 04, 2008 1:02 pm

My pleasure.  :D

You might like to try some tests because as far as I understand it (reading the work of others, not testing), the varchar is 3 times faster than text ONLY if it is in the index being used to reference the table. Otherwise, they are the same. For the opencart product and category tables, the strings are not in the index.

I am happy to be corrected with some hard data though. Always good to learn something new.

Cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by sakathecheetah » Fri Jul 04, 2008 1:55 pm

You might like to try some tests because as far as I understand it (reading the work of others, not testing), the varchar is 3 times faster than text ONLY if it is in the index being used to reference the table. Otherwise, they are the same. For the opencart product and category tables, the strings are not in the index.

I am happy to be corrected with some hard data though. Always good to learn something new.
naw... that's exactly what I was thinking of, actually. Just from a syntactic style view I think varchar represents a one-line string better. Plus you never know when you might want to slap it into an index on some future mod right?  ;D ;)

New member

Posts

Joined
Wed Jul 02, 2008 8:50 am
Who is online

Users browsing this forum: No registered users and 3 guests