[-] MO : retro compatibility fixed with Referral program #PSCFV-1531

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15028 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
dMetzger
2012-05-03 08:34:18 +00:00
parent 8375992d2d
commit 0e2d9240bd
5 changed files with 27 additions and 15 deletions
+17 -5
View File
@@ -126,7 +126,7 @@ class DiscountCore extends CartRule
{
Tools::displayAsDeprecated();
$obj = $this->parent;
if (in_array($method, array('add', 'update', 'getIdByName', 'getCustomerDiscounts', 'getValue', 'discountExists', 'createOrderDiscount', 'getVouchersToCartDisplay')))
if (in_array($method, array('add', 'update', 'getIdByName', 'getCustomerDiscounts', 'getValue', 'discountExists', 'createOrderDiscount', 'getVouchersToCartDisplay', 'display')))
$obj = $this;
return call_user_func_array(array($obj, $method), $args);
}
@@ -202,10 +202,7 @@ class DiscountCore extends CartRule
* @deprecated 1.5.0.1
*/
public static function createOrderDiscount($order, $productList, $qtyList, $name, $shipping_cost = false, $id_category = 0, $subcategory = 0)
{
// Todo
//die ('TODO');
{
$languages = Language::getLanguages($order);
$products = $order->getProducts(false, $productList, $qtyList);
@@ -252,4 +249,19 @@ class DiscountCore extends CartRule
return $voucher;
}
/**
* @deprecated 1.5.0.1
*/
public static function display($value, $type, $currency = null)
{
if ((float)$value && (int)$type)
{
if ($type == 1)
return $value.chr(37); // ASCII #37 --> % (percent)
elseif ($type == 2)
return Tools::displayPrice($value, $currency);
}
return ''; // return a string because it's a display method
}
}