NielsTy Posted September 26, 2016 Share Posted September 26, 2016 (edited) Dear all. I have a bit of a problem with my shop (PS 1.6.1.6). I desperately need to be able to have more than 32 characters in the Reference fields of my product combinations (i get this error when trying to import from csv:Property Combination->reference length (37) must be between 0 and 32 ) I am not a wizard in php, and i couldn't really find a solution in the forum for this problem. There are solutions when it comes to other field lengths, but not for this one, and i am not able to use the info for my specific needs! Can anybody guide me in the right direction? It will be much appreciated With kind regards, Niels Edited September 26, 2016 by NielsTy (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 28, 2016 Share Posted September 28, 2016 Create override/classes/Combination.php with the following: <?php class Combination extends CombinationCore { public function __construct() { CombinationCore::$definition['fields']['reference']['size'] = 64; parent::__construct(); } } This will increase the field size to 64 characters. Remember to go to Advanced Parameters > Performance and click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. You'll also need to log in to your database using phpMyAdmin, edit the structure of the reference field in the ps_product_attribute table and change the type from varchar(32) to varchar(64). 1 Link to comment Share on other sites More sharing options...
NielsTy Posted October 7, 2016 Author Share Posted October 7, 2016 Create override/classes/Combination.php with the following: <?php class Combination extends CombinationCore { public function __construct() { CombinationCore::$definition['fields']['reference']['size'] = 64; parent::__construct(); } } This will increase the field size to 64 characters. Remember to go to Advanced Parameters > Performance and click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop can find the override. You'll also need to log in to your database using phpMyAdmin, edit the structure of the reference field in the ps_product_attribute table and change the type from varchar(32) to varchar(64). Worked like a dream... awesome! Thanks Link to comment Share on other sites More sharing options...
kimwebfan Posted April 18, 2017 Share Posted April 18, 2017 Hello! I'm trying to increase the supplier_reference and reference fields to 64 characters but I still have an error on importing the CSV. Is this solution working with PS 1.7? Best regards Link to comment Share on other sites More sharing options...
Guantanamo Posted September 21, 2018 Share Posted September 21, 2018 (edited) File /classes/Combination.php Change 'reference' => array('type' => self::TYPE_STRING, 'size' => 32), to 'reference' => array('type' => self::TYPE_STRING, 'size' => 64), and Change varchar(32) to varchar(64) on your Data base Edited September 21, 2018 by Guantanamo (see edit history) 1 Link to comment Share on other sites More sharing options...
irvingvd Posted May 5, 2019 Share Posted May 5, 2019 Gracias cubano Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now