// MERGE with 1.4 r7770

This commit is contained in:
rMalie
2011-07-28 09:20:57 +00:00
parent 60b07cacb9
commit c17e7c236d
968 changed files with 26082 additions and 3937 deletions
+10 -10
View File
@@ -63,7 +63,7 @@ class LoyaltyModule extends ObjectModel
$this->historize();
}
static public function getByOrderId($id_order)
public static function getByOrderId($id_order)
{
if (!Validate::isUnsignedId($id_order))
return false;
@@ -76,14 +76,14 @@ class LoyaltyModule extends ObjectModel
return isset($result['id_loyalty']) ? $result['id_loyalty'] : false;
}
static public function getOrderNbPoints($order)
public static function getOrderNbPoints($order)
{
if (!Validate::isLoadedObject($order))
return false;
return self::getCartNbPoints(new Cart((int)$order->id_cart));
}
static public function getCartNbPoints($cart, $newProduct = NULL)
public static function getCartNbPoints($cart, $newProduct = NULL)
{
$total = 0;
if (Validate::isLoadedObject($cart))
@@ -118,7 +118,7 @@ class LoyaltyModule extends ObjectModel
return self::getNbPointsByPrice($total);
}
static public function getVoucherValue($nbPoints, $id_currency = NULL)
public static function getVoucherValue($nbPoints, $id_currency = NULL)
{
global $cookie;
@@ -128,7 +128,7 @@ class LoyaltyModule extends ObjectModel
return (int)$nbPoints * (float)Tools::convertPrice(Configuration::get('PS_LOYALTY_POINT_VALUE'), new Currency((int)$id_currency));
}
static public function getNbPointsByPrice($price)
public static function getNbPointsByPrice($price)
{
global $cookie;
@@ -147,7 +147,7 @@ class LoyaltyModule extends ObjectModel
return (int)$points;
}
static public function getPointsByCustomer($id_customer)
public static function getPointsByCustomer($id_customer)
{
return
Db::getInstance()->getValue('
@@ -163,7 +163,7 @@ class LoyaltyModule extends ObjectModel
AND f.id_loyalty_state = '.(int)LoyaltyStateModule::getCancelId().' AND points < 0');
}
static public function getAllByIdCustomer($id_customer, $id_lang, $onlyValidate = false, $pagination = false, $nb = 10, $page = 1)
public static function getAllByIdCustomer($id_customer, $id_lang, $onlyValidate = false, $pagination = false, $nb = 10, $page = 1)
{
$query = '
SELECT f.id_order AS id, f.date_add AS date, (o.total_paid - o.total_shipping) total_without_shipping, f.points, f.id_loyalty, f.id_loyalty_state, fsl.name state
@@ -179,7 +179,7 @@ class LoyaltyModule extends ObjectModel
return Db::getInstance()->ExecuteS($query);
}
static public function getDiscountByIdCustomer($id_customer, $last=false)
public static function getDiscountByIdCustomer($id_customer, $last=false)
{
$query = '
SELECT f.id_discount AS id_discount, f.date_upd AS date_add
@@ -195,7 +195,7 @@ class LoyaltyModule extends ObjectModel
return Db::getInstance()->ExecuteS($query);
}
static public function registerDiscount($discount)
public static function registerDiscount($discount)
{
if (!Validate::isLoadedObject($discount))
die(Tools::displayError('Incorrect object Discount.'));
@@ -216,7 +216,7 @@ class LoyaltyModule extends ObjectModel
}
}
static public function getOrdersByIdDiscount($id_discount)
public static function getOrdersByIdDiscount($id_discount)
{
$items = Db::getInstance()->ExecuteS('
SELECT f.id_order AS id_order, f.points AS points, f.date_upd AS date