Increase length of Product Name field in Zen Cart


The default field length for Product Name in Zen Cart is 64 characters.  In some cases this may not be enough and today we are going to step through increasing this field to support longer product names.

Product Name in Zen Cart

As this is not a setting in Zen Cart Admin, we will need to make the change directly in the relevant database tables.  In this example we will be using cPanel and phpMyAdmin.

  1. Log in to your cPanel Control Panel

    Your cPanel is located at either http://YourSitesIPAddress/cpanel (for example, http://1.2.3.4/cpanel), or http://www.yourdomainname.com/cpanel or http://cpanel.yourdomainname.com/.

    Your cPanel username and password will generally be found in a welcome email from your webhost.

    Scroll down to the section Databases and click on phpMyAdmin.
    cPanel - phpMyAdmin

  2. Select the Zen Cart database from the menu on the left hand side of phpMyAdmin.
    Select Database in phpMyAdmin

  3. The Zen Cart database tables will now be displayed in the left hand side menu.  The first table that we need to modify is products_description or, with the prefix, zen_products_description.  Select this table.
     phpMyAdmin - Zen Cart database tables

  4. Select the Structure tab and then click on the Change icon (pencil).
    Change table structure

  5. In the Length/Values field, change the value from 64 to the number of characters required.  In this case we are changing the field to accept up to 128 characters.

    Click the Save button to save your change.
    Save change
    You will see a Table zen_products_description has been altered successfully message or similar.

  6. The orders_products (or zen_orders_products) table will also need to be updated.  Select this table from the left hand menu and then select the Structure tab.  Click on the Change icon (pencil).
    zen_orders_products

  7. In the Length/Values field, change the value from 64 to the same number of characters as above.  So, in this example we are changing the field to accept up to 128 characters.

    Click the Save button to save your change.

    You will see a Table zen_orders_products has been altered successfully message or similar.
    Cha

And that’s it.  You will now be able to enter product names up to the number of characters specified in the database tables.

     
   
     

More Zen Cart:

  1. Increase length of Manufacturer field in Zen Cart
  2. Disable Downloads to increase Zen Cart performance
  3. Disable Price Factor to increase Zen Cart performance
  4. Disable Attribute Images to increase Zen Cart performance
  5. Store in Spotlight: Forman and Field
  1. #1 by Claudia on 24 April, 2010 - 6:44 pm

    What about the _customers_wishlist table? It seems that products_name is defined there as well as VARCHAR(64).

  2. #2 by kerrin hardy on 24 April, 2010 - 10:15 pm

    Hi Claudia, while it won’t hurt updating the products_name field, the customers_wishlist table is not used in the current code. It was included in preparation for a future release.

  3. #3 by francine on 2 June, 2011 - 10:37 pm

    I’ve done exactly that and the longer product name stays the same…I’ve waited a couple of days to see if it’s slow or something…but am still in a bind.

  4. #4 by kerrin hardy on 4 June, 2011 - 11:07 pm

    Hi Francine, what do you mean by ‘the longer product stays the same’? When you log back into the database (via phpMyAdmin) does the new length show or is it still set to 64 characters?

    Once the change is made in the database, you will need to update the product by entering in the longer product name (now that it will accept it).

    Let me know how you get on,
    Kerrin

  5. #5 by Francine on 4 June, 2011 - 11:51 pm

    The new length is in my data base via phpMyAdmin ( I checked) but it stays the same length on my webstore…it doesn’t seem to accept it for some reason, I still can’t type my longer product name. I changed it
    to 125…

  6. #6 by kerrin hardy on 5 June, 2011 - 10:13 am

    Francine, I’m just wondering you may need to clear the cache on the browser you are using or use a different one and try it there. You can also try adding a ? to the end of the edit product page’s URL in the address bar – this tells the browswer to go back to the server for a new copy of the page.

    If this doesn’t work, I could have a quick look for you.

  7. #7 by Francine on 5 June, 2011 - 10:45 am

    I didn’t know the ? trick…learned something new :-) I emptied the cache many times, even using ccleaner as well as the Firefox one. Still nothing. I went back into mysql and changed it to 175 to see if it changed things, but it still stays at 64…

    What do you mean by having a quick look?

  8. #8 by kerrin hardy on 5 June, 2011 - 11:03 am

    Hi Francine, it would mean sending me a password for your control panel and store admin. You can create a new account and then delete or just change the passwords afterwards. My email address is info@kerrinhardy.com.

(will not be published)

Notify me of followup comments via e-mail. You can also subscribe without commenting.