* @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ function add_carrier_position() { $carriers = Db::getInstance()->executeS(' SELECT `id_carrier` FROM `'._DB_PREFIX_.'carrier` WHERE `deleted` = 0'); if (count($carriers) && is_array($carriers)) { $i = 0; foreach ($carriers as $carrier) { Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'carrier` SET `position` = '.$i++.' WHERE `id_carrier` = '.(int)$carrier['id_carrier']); } } }