adriesilva Posted August 22, 2013 Share Posted August 22, 2013 (edited) Hello, it seems that the store coordinates works fine except when my location is over Negative 100. I then get the error that says, the Longitude field is too long (12 characters max). Prestashop by default adds zeros and that makes my longitude 13 characters. What are my options here? Any and all help is appreciated. My coordinates are 33.832979 latitude & -117.927681 longitude. Edited August 22, 2013 by adriesilva (see edit history) Link to comment Share on other sites More sharing options...
swsindonesia Posted August 22, 2013 Share Posted August 22, 2013 Hi, Unfortunately that rule of 12 characters is located in the PS code, not configurable. 1. copy controllers/admin/AdminStoresController.php to override/controllers/admin/ edit override/controllers/admin/AdminStoresController.php line 224 change 'maxlength' => 12, to 'maxlength' => 14, 2. copy classes/Store.php to override/classes/ edit override/classes/Store.php line 94, 95 change 'latitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate', 'size' => 12), 'longitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate', 'size' => 12), to 'latitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate', 'size' => 14), 'longitude' => array('type' => self::TYPE_FLOAT, 'validate' => 'isCoordinate', 'size' => 14), 3. IMPORTANT: go to folder cache, DELETE file class_index.php after you finish copy and editing those two files by using override folder, you will not break anything in PS core, and your PS installation is still fully upgradable. 1 Link to comment Share on other sites More sharing options...
Recommended Posts