[-] Classes : #PSFV-634 : BugFix Currency was not set for loyalty discounts

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14110 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
fGaillard
2012-03-13 17:06:42 +00:00
parent 998ef4263e
commit 7a6339d50f
6 changed files with 22 additions and 16 deletions
+10 -10
View File
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>loyalty</name>
<displayName><![CDATA[Customer loyalty and rewards]]></displayName>
<version><![CDATA[1.8]]></version>
<description><![CDATA[Provide a loyalty program to your customers.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[pricing_promotion]]></tab>
<module>
<name>loyalty</name>
<displayName><![CDATA[Customer loyalty and rewards]]></displayName>
<version><![CDATA[1.8]]></version>
<description><![CDATA[Provide a loyalty program to your customers.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[pricing_promotion]]></tab>
<confirmUninstall>Are you sure you want to delete all loyalty points and customer history?</confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>
</module>
@@ -36,6 +36,8 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController
{
parent::__construct();
$this->context = Context::getContext();
include_once($this->module->getLocalPath().'LoyaltyModule.php');
include_once($this->module->getLocalPath().'LoyaltyStateModule.php');
@@ -69,8 +71,8 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController
// Voucher creation and affectation to the customer
$cartRule = new CartRule();
$cartRule->code = $voucherCode;
$cartRule->id_customer = (int)$this->context->cookie->id_customer;
$cartRule->id_currency = (int)$this->context->cookie->id_currency;
$cartRule->id_customer = (int)$this->context->customer->id;
$cartRule->reduction_currency = (int)$this->context->currency->id;
$cartRule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customerPoints);
$cartRule->quantity = 1;
$cartRule->quantity_per_user = 1;
@@ -114,7 +116,7 @@ class LoyaltyDefaultModuleFrontController extends ModuleFrontController
// Register order(s) which contributed to create this voucher
LoyaltyModule::registerDiscount($cartRule);
Tools::redirect($this->context->link->getModuleLink('loyalty', 'default'));
Tools::redirect($this->context->link->getModuleLink('loyalty', 'default', array('process' => 'summary')));
}
}
+1 -1
View File
@@ -229,6 +229,7 @@ class Loyalty extends Module
$errors .= $error.'<br />';
echo $this->displayError($errors);
}
// redirect($this->context->link);
}
}
@@ -246,7 +247,6 @@ class Loyalty extends Module
$this->instanceDefaultStates();
$this->_postProcess();
$categories = Category::getCategories($this->context->language->id);
$order_states = OrderState::getOrderStates($this->context->language->id);
$currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT')));
$defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
@@ -129,6 +129,9 @@
{/if}
<br />
<br />
<br />
<h2>{l s='My vouchers from loyalty points' mod='loyalty'}</h2>
{if $nbDiscounts}