New Zenner
- Join Date:
- Mar 2006
- Posts:
- 65
- Plugin Contributions:
- 0
A Categories / Products can only be 31 letters?
Is there any way to make the name of category longer than 31 letters/signs or whatever it is? There's a limit, how do i change that?
Views: 3,670
New Zenner
Is there any way to make the name of category longer than 31 letters/signs or whatever it is? There's a limit, how do i change that?
Totally Zenned
I guess you have to make change in the
admin\categories.php
where it says
$category_inputs_string = '';
$languages = zen_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
}
Might not be the best way, but this is the only one I know of!
San
advanced.programmer at gmail dot com
In love with Zen Cart!!
New Zenner
found it, but what should i change?
Totally Zenned
Well before I suggest the solution I just want to say that be very careful when you edit the code...
So here it is
just after that code say
echo htmlspecialchars($category_inputs_string);
You will get output like
<br /><img src="http://localhost/zencart/includes/languages/english/images/icon.gif" border="0" alt="English" title=" English "> <input type="text" name="categories_name[1]" size = "33" maxlength = "32">
This is the value which is getting assinged to $category_inputs_string
(this step was just for understanding as to whats happening!)
You can change it now by assigning it like this after removing the echo statement
See how I have changed the value of size and maxlength...
So final code looks like
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
}
//echo htmlspecialchars($category_inputs_string);
$category_inputs_string='<br /><img src="http://localhost/zencart/includes/languages/english/images/icon.gif" border="0" alt="English" title=" English "> <input type="text" name="categories_name[1]" size = "133" maxlength = "132">';
advanced.programmer at gmail dot com
In love with Zen Cart!!
New Zenner
You've tryed it so you know it's working?
I put
$category_inputs_string = '<br /><img src="http://localhost/zencart/includes/languages/english/images/icon.gif" border="0" alt="English" title=" English "> <input type="text" name="categories_name[1]" size = "133" maxlength = "132">';
$languages = zen_get_languages();
for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
$category_inputs_string .= '<br />' . zen_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . zen_draw_input_field('categories_name[' . $languages[$i]['id'] . ']', '', zen_set_field_length(TABLE_CATEGORIES_DESCRIPTION, 'categories_name'));
}
//echo htmlspecialchars($category_inputs_string);
$category_inputs_string='<br /><img src="http://localhost/zencart/includes/languages/english/images/icon.gif" border="0" alt="English" title=" English "> <input type="text" name="categories_name[1]" size = "133" maxlength = "132">';
Correct?
Totally Zenned
Right...Did that work for you?
advanced.programmer at gmail dot com
In love with Zen Cart!!
Zen Follower
doesn't this change need to happen in the database too?
New Zenner
superprg:
Right...Did that work for you?
Nope, nothing =(
Oba-san
Guys ... that is a self-learning function that is based on physical size of the categories_description field length for:
categories_name varchar(32)
As you change the physical size in the database table categories_description it will automatically grow in the code there ... :smartass:
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
New Zenner
So how do i change the physical size in the database table categories_description?
Totally Zenned
liah:
So how do i change the physical size in the database table categories_description?
Change varchar(32) for categories_name to varchar(60) etc
advanced.programmer at gmail dot com
In love with Zen Cart!!
New Zenner
superprg:
Change varchar(32) for categories_name to varchar(60) etc
I only get two hits on "varchar" by using the developers tool kit ..
___ admin/sqlpatch.php _________________________________
Line #646 : sql_file varchar(50) default NULL,
Line #647 : reason varchar(200) default NULL,
Sorry if i come off as a retard ;) Don't have much experience with Zencart.
Black Belt
Quoting Ajeh:
As you change the physical size in the database table categories_description it will automatically grow in the code there ...
First, using phpmyadmin, backup your DB(always backup)
open your DB and find categories_description to the right is an icon for structure, hover over each to find. select structure.
Find categories_name ........varchar(32), at the right(you might have to scroll to the right) there is a pencil icon, select this.
There is now a field titled "Length/Values" and 32 in the box below.
Change the value in this box to a reasonable value then select save. Then exit.
Now if all has gone well, as Ajeh states Zen will automatically have grown this field.
Don't forget to BACKUP first
Zen-Venom Get Bitten
New Zenner
Never figured out phpmyadmin. What do i do with it? Seems like it's just a bunch of php files? How do i use it with ZenCart?
Black Belt
With your hosting account, do you have cPanel access? Is it CpanelX or plesk?
It is through this interface(either) that you can access your DB's directly.
phpmyadmin is a graphical interface for mysql administration and not just a bunch of php. So if you have not seen or entered this GUI you are not actually using phpmyadmin.
Zen-Venom Get Bitten
New Zenner
Hi there,
I did these changes in the db but nothing changed with the lenght of the file names at all :(
I don`t know what to do, is there any other way or limit in the db for the varchar symbols
thank you:lamo:
New Zenner
I finally figured it out. Thanks for the help guys!
Oba-san
What was the solution? :smile:
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
New Zenner
Hi there, I made it too, the answer in my case was that I reinstalled it all but before starting to configure the store I made the changes at the data base and then all was perfect. I`m not sure is this the only way or it was some problem with my server but now everithing is fine so... good luck everyone :sleepy:
Oba-san
Make sure you change all references to products_name in all tables such as:
products_description
orders_products
or they will get cut off when Products are ordered ... :eek:
Linda McGrath
If you have to think ... you haven't been zenned ...
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Tell staff why this post should be reviewed.