Forums / Templates, Stylesheets, Page Layout / A Categories / Products can only be 31 letters?

A Categories / Products can only be 31 letters?

Locked

Views: 3,670

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
2 Oct 2006, 9:27 PM
#1
liah avatar

liah

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?

2 Oct 2006, 10:04 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

2 Oct 2006, 10:23 PM
#3
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

found it, but what should i change?

2 Oct 2006, 10:33 PM
#4
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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


$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">';

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">';

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

2 Oct 2006, 11:04 PM
#5
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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?

2 Oct 2006, 11:12 PM
#6
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

Right...Did that work for you?

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

3 Oct 2006, 12:12 AM
#8
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

superprg:

Right...Did that work for you?

Nope, nothing =(

3 Oct 2006, 1:19 AM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: A Categories / Products can only be 31 letters?

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 ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

3 Oct 2006, 10:53 AM
#10
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

So how do i change the physical size in the database table categories_description?

3 Oct 2006, 10:57 AM
#11
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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

Tutorials on Zen Cart
http://tutorials.zen-cart.com/index.php

advanced.programmer at gmail dot com
In love with Zen Cart!!

3 Oct 2006, 11:43 AM
#12
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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.

3 Oct 2006, 12:16 PM
#13
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: A Categories / Products can only be 31 letters?

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

3 Oct 2006, 9:48 PM
#14
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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?

4 Oct 2006, 12:07 AM
#15
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: A Categories / Products can only be 31 letters?

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

9 Oct 2006, 10:38 AM
#16
larrsen avatar

larrsen

New Zenner

Join Date:
Oct 2006
Posts:
2
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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:

20 Oct 2006, 7:27 PM
#17
liah avatar

liah

New Zenner

Join Date:
Mar 2006
Posts:
65
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

I finally figured it out. Thanks for the help guys!

21 Oct 2006, 12:10 AM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: A Categories / Products can only be 31 letters?

What was the solution? :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!

29 Oct 2006, 6:17 PM
#19
larrsen avatar

larrsen

New Zenner

Join Date:
Oct 2006
Posts:
2
Plugin Contributions:
0

Re: A Categories / Products can only be 31 letters?

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:

7 Nov 2007, 3:04 AM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: A Categories / Products can only be 31 letters?

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 ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

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!