captainschoice Posted August 27, 2013 Share Posted August 27, 2013 Because we sell products from both Mexico which uses a 13 digit UPC code and the USA which is 12 we would like to be able to enter both in the UPC text box for items. Is it possible to change the length of the entry so that it does not truncate the 13th digit? This would be preferable to us than entering the Mexican UPC in the EAN13 slot as a European code. Link to comment Share on other sites More sharing options...
El Patron Posted August 27, 2013 Share Posted August 27, 2013 see here http://forge.prestashop.com/browse/PSCFV-9309 I haven't looked at it but creating a hack to do it would not seem that hard to do. Link to comment Share on other sites More sharing options...
captainschoice Posted August 27, 2013 Author Share Posted August 27, 2013 I guess that is above my capability. Link to comment Share on other sites More sharing options...
swsindonesia Posted August 27, 2013 Share Posted August 27, 2013 Hi, just like the latitude / longitude size problem http://www.prestashop.com/forums/topic/269436-longitude-field-error-i-can-not-enter-my-google-map-location/page__p__1347972#entry1347972 the upc size is coded inside PS class variable, and not configurable. You need to manually change the size setting classes/Product.php line 260 'upc' => array('type' => self::TYPE_STRING, 'validate' => 'isUpc', 'size' => 12), change the size to whatever number you require. Please see the latitude / longitude topic first for details about using override folder and removing cache/class_index.php 2 Link to comment Share on other sites More sharing options...
El Patron Posted August 27, 2013 Share Posted August 27, 2013 What is your exact ps version? could you use the ean13 field along with the 12 byte upc fiield? http://screencast.com/t/oe7wFKQftl3u I don't use the ean or upc fields so I am not sure how that works out for example with .csv and other aspects you might require. Link to comment Share on other sites More sharing options...
El Patron Posted August 27, 2013 Share Posted August 27, 2013 as for adding 13 byte upc, it's rather more than a simple array update 1. the db has a varchar limit 12 (would require expanded to 13) 2. all the input forms limit to 12 (products/combinations) forms would need to be modified to support 13 3. and various other tid bits Link to comment Share on other sites More sharing options...
captainschoice Posted August 27, 2013 Author Share Posted August 27, 2013 Thanks, I think that will do it. Now if I can just find out how to change the settings so that I do not keep getting logged out of the admin panel because I take a little while to locate product information Link to comment Share on other sites More sharing options...
sylarlocke Posted August 9, 2018 Share Posted August 9, 2018 Hi, I know this topic is old, but if somebody have this issues with ps 1.6.1.18 need change too those files: \classes\validate.php public static function isUpc($upc) { return !$upc || preg_match('/^[0-9]{0,12}$/', $upc);//change 12 by number you choice } Change too in: \class\product.php y en combination.php 'upc' =>array('type' => self::TYPE_STRING, 'validate' => 'isUpc', 'size' => 12);//change12 by number you choice Good luck! 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