Merge branch 'ticket-12643-OpenLoyaltyEs' into develop

This commit is contained in:
Marion Muszynski 2017-03-22 17:00:55 +01:00
commit 45e607b627
2 changed files with 23 additions and 23 deletions

View File

@ -1,6 +1,6 @@
<?php
/*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@ -40,9 +40,9 @@ if (!$cookie->isLogged())
// ANTADIS si espagne redirect
global $site_version;
if ($cookie->id_lang == 3 || $site_version == 'es') {
Tools::redirect('my-account.php');
}
// if ($cookie->id_lang == 3 || $site_version == 'es') {
// Tools::redirect('my-account.php');
// }
Tools::addCSS(_PS_CSS_DIR_.'jquery.cluetip.css', 'all');
Tools::addJS(array(_PS_JS_DIR_.'jquery/jquery.dimensions.js',_PS_JS_DIR_.'jquery/jquery.cluetip.js'));
@ -88,21 +88,21 @@ if (Tools::getValue('transform-points') == 'true' AND $total_discount > 0)
$voucher->cumulable = 1;
$voucher->cumulable_reduction = 1;
$voucher->cart_display = 1;
/* If merchandise returns are allowed, the voucher musn't be usable before this max return date */
/* If merchandise returns are allowed, the voucher musn't be usable before this max return date */
$dateFrom = Db::getInstance()->getValue('
SELECT UNIX_TIMESTAMP(date_add) n
FROM '._DB_PREFIX_.'loyalty
FROM '._DB_PREFIX_.'loyalty
WHERE id_discount = 0 AND id_customer = '.(int)$cookie->id_customer.'
ORDER BY date_add DESC');
if (Configuration::get('PS_ORDER_RETURN'))
$dateFrom += 60 * 60 * 24 * (int)Configuration::get('PS_ORDER_RETURN_NB_DAYS');
$voucher->date_from = date('Y-m-d H:i:s', $dateFrom);
$voucher->date_to = date('Y-m-d H:i:s', $dateFrom + 31536000); // + 1 year
$voucher->minimal = (float)Configuration::get('PS_LOYALTY_MINIMAL');
$voucher->active = 1;
@ -115,7 +115,7 @@ if (Tools::getValue('transform-points') == 'true' AND $total_discount > 0)
$languages = Language::getLanguages(true);
$default_text = Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int)(Configuration::get('PS_LANG_DEFAULT')));
foreach ($languages AS $language)
{
$text = Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int)($language['id_lang']));

View File

@ -496,9 +496,9 @@ class Loyalty extends Module
public function hookExtraRight($params)
{
global $site_version;
if ($site_version == 'es') {
return;
}
// if ($site_version == 'es') {
// return;
// }
include_once(dirname(__FILE__).'/LoyaltyModule.php');
global $smarty;
@ -541,9 +541,9 @@ class Loyalty extends Module
public function hookCustomerAccount($params)
{
global $site_version, $cookie;
if ($site_version == 'es' || $cookie->id_lang == 3) {
return;
}
// if ($site_version == 'es' || $cookie->id_lang == 3) {
// return;
// }
return $this->display(__FILE__, 'my-account.tpl');
}
@ -598,9 +598,9 @@ class Loyalty extends Module
public function hookShoppingCart($params)
{
global $site_version, $smarty;
if ($site_version == 'es') {
return;
}
// if ($site_version == 'es') {
// return;
// }
include_once(dirname(__FILE__).'/LoyaltyModule.php');
if (Validate::isLoadedObject($params['cart']))
@ -628,9 +628,9 @@ class Loyalty extends Module
die(Tools::displayError('Missing parameters'));
global $site_version;
if ($site_version == 'es' || (int)$params['order']->id_lang == 3) {
return true;
}
// if ($site_version == 'es' || (int)$params['order']->id_lang == 3) {
// return true;
// }
$loyalty = new LoyaltyModule();
$loyalty->id_customer = (int)$params['customer']->id;
$loyalty->id_order = (int)$params['order']->id;