From e1c0bcf50211ccbb16cb484c4d6277cb0c69367d Mon Sep 17 00:00:00 2001 From: rGaillard Date: Fri, 13 Jul 2012 15:51:44 +0000 Subject: [PATCH] [-] BO: Fix PSCFV-3186 git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16422 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/SpecificPrice.php | 2 +- controllers/admin/AdminSpecificPriceRuleController.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/SpecificPrice.php b/classes/SpecificPrice.php index cbcd63f67..7c5068878 100644 --- a/classes/SpecificPrice.php +++ b/classes/SpecificPrice.php @@ -229,7 +229,7 @@ class SpecificPriceCore extends ObjectModel (`to` = \'0000-00-00 00:00:00\' OR \''.$now.'\' <= `to`) ) AND id_cart IN (0, '.(int)$id_cart.')'. - (($real_quantity != 0 && !Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION')) ? ' AND `from_quantity` <= IF(id_product_attribute=0,'.(int)$quantity.' ,'.(int)$real_quantity.')' : 'AND `from_quantity` <= '.(int)$real_quantity).' + (($real_quantity != 0 && !Configuration::get('PS_QTY_DISCOUNT_ON_COMBINATION')) ? ' AND IF(`from_quantity` > 1, `from_quantity`, 0) <= IF(id_product_attribute=0,'.(int)$quantity.' ,'.(int)$real_quantity.')' : 'AND `from_quantity` <= '.(int)$real_quantity).' ORDER BY `id_product_attribute` DESC, `from_quantity` DESC, `id_specific_price_rule` ASC, `score` DESC'); } return self::$_specificPriceCache[$key]; diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index 1e23d479a..57bb0a701 100755 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -257,15 +257,16 @@ class AdminSpecificPriceRuleControllerCore extends AdminController 'class' => 'button' ), ); - if ($value = $this->getFieldValue($this->object, 'price') != -1) + if (($value = $this->getFieldValue($this->object, 'price')) != -1) $price = number_format($value, 2); else $price = ''; + $this->fields_value = array( 'price' => $price, 'from_quantity' => (($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1), 'reduction' => number_format((($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0), 2), - 'leave_bprice_on' => ($value = $this->getFieldValue($this->object, 'price')) ? $value : 1 + 'leave_bprice_on' => $price ? 0 : 1 ); $attribute_groups = array();