product codes are longer than 32 characters - how do i change it

product codes are longer than 32 characters - how do i change it easily

open database, find any tables with (product_code as field name and change the length field… make sure all match.

If using cpanel then you open DB with my php admin. You will need to hit the lityle cog top right of screen to open settings, change max tree from 50 to 200, otherwise you wont see all the tables.

Do in dev store and test a variety of things. If there is no validation in the code this should work (worked for changing length of SEO meta description).

Coukd break sh*t so dev store testing is a must

By default, product code allows codes with maximum length of 64 symbols.

If you need change the limit, you will need to alter the products table and change the product_code column:

ALTER TABLE `cscart_products`CHANGE `product_code` `product_code` varchar(100) NOT NULL DEFAULT '' AFTER `product_id`;

replace 100 with the necessary value.

And in the app/Tygh/Enum/ProductFieldsLength.php file change the value in the following string:

const PRODUCT_CODE = 64;
1 Like