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. Back up the Zen Cart Database with phpMyAdmin
  3. Increase the number of Manufacturers shown in the Manufacturers Sidebox of Zen Cart
  4. Configure the Zen Cart Reviews Sidebox to randomly select product reviews for display
  5. How to do a complete Backup of your Zen Cart Store
  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.

(will not be published)