// Use id_order for reference order for old orders (1.4)
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13305 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
function generate_order_reference()
|
|
||||||
{
|
|
||||||
$res = true;
|
|
||||||
// Get all orders
|
|
||||||
$orders = Db::getInstance()->executeS('SELECT id_order FROM '._DB_PREFIX_.'orders');
|
|
||||||
foreach ($orders as $order)
|
|
||||||
{
|
|
||||||
$random_ref = '';
|
|
||||||
for ($i = 0, $passwd = ''; $i < 9; $i++)
|
|
||||||
$random_ref .= substr('ABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(0,25), 1);
|
|
||||||
$res &= Db::getInstance()->execute('
|
|
||||||
UPDATE '._DB_PREFIX_.'orders
|
|
||||||
SET reference = \''.$random_ref.'\'
|
|
||||||
WHERE id_order = '.(int)$order['id_order']);
|
|
||||||
}
|
|
||||||
return $res;
|
|
||||||
}
|
|
||||||
@@ -328,7 +328,7 @@ ALTER TABLE `PREFIX_order_cart_rule` ADD `id_order_invoice` INT NOT NULL DEFAULT
|
|||||||
ALTER TABLE `PREFIX_specific_price` ADD `id_group_shop` INT(11) UNSIGNED NOT NULL AFTER `id_shop`;
|
ALTER TABLE `PREFIX_specific_price` ADD `id_group_shop` INT(11) UNSIGNED NOT NULL AFTER `id_shop`;
|
||||||
|
|
||||||
/* Generate order references */
|
/* Generate order references */
|
||||||
/* PHP:generate_order_reference(); */;
|
UPDATE `PREFIX_orders` SET `reference` = id_order;
|
||||||
|
|
||||||
ALTER TABLE `PREFIX_order_detail` ADD `tax_computation_method` tinyint(1) unsigned NOT NULL default '0' AFTER `product_weight`;
|
ALTER TABLE `PREFIX_order_detail` ADD `tax_computation_method` tinyint(1) unsigned NOT NULL default '0' AFTER `product_weight`;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user