From da841a720b2e044f1c2fab9124c8b65fd4dbde59 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Wed, 29 Aug 2012 12:11:08 +0000 Subject: [PATCH] // Fixed cast problem in upgrade #PSCFV-3799 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@17067 b9a71923-0436-4b27-9f14-aed3839534dd --- install-dev/upgrade/php/migrate_orders.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install-dev/upgrade/php/migrate_orders.php b/install-dev/upgrade/php/migrate_orders.php index 9ce42f810..3de5a0c07 100644 --- a/install-dev/upgrade/php/migrate_orders.php +++ b/install-dev/upgrade/php/migrate_orders.php @@ -110,7 +110,11 @@ function migrate_orders() if (!in_array($k, $col_order_detail)) unset($order_details[$k]); else + { + if (in_array($order_details[$k], array('product_price', 'reduction_percent', 'reduction_amount', 'group_reduction', 'product_quantity_discount', 'tax_rate', 'ecotax', 'ecotax_tax_rate'))) + $order_details[$k] = (float)$order_details[$k]; $order_details[$k] = Db::getInstance()->escape($order_details[$k]); + } $values_order_detail[] = '(\''.implode('\', \'', $order_details).'\')'; } @@ -164,7 +168,7 @@ function migrate_orders() } } - if ($cpt > 0) + if (count($values_order_detail)) { if (!Db::getInstance()->execute($insert_order_detail. implode(',', $values_order_detail)))