// Log edited, this modification on Module::displayTemplate was reverted in a better one

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10675 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-11-25 16:09:13 +00:00
parent 93f4be96b0
commit fe435bdeea
8 changed files with 53 additions and 30 deletions
+10 -10
View File
@@ -1,6 +1,6 @@
<?php
/*
* 2007-2011 PrestaShop
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
@@ -59,20 +59,20 @@ if (Tools::getValue('transform-points') == 'true' AND $customerPoints > 0)
$cartRule->reduction_amount = LoyaltyModule::getVoucherValue((int)$customerPoints);
$cartRule->quantity = 1;
$cartRule->quantity_per_user = 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_cart_rule = 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');
$cartRule->date_from = date('Y-m-d H:i:s', $dateFrom);
$cartRule->date_to = date('Y-m-d H:i:s', $dateFrom + 31536000); // + 1 year
$cartRule->minimum_amount = (float)Configuration::get('PS_LOYALTY_MINIMAL');
$cartRule->active = 1;
@@ -84,13 +84,13 @@ if (Tools::getValue('transform-points') == 'true' AND $customerPoints > 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']);
$cartRule->name[(int)$language['id_lang']] = $text ? strval($text) : strval($default_text);
}
if (is_array($categories) AND sizeof($categories))
$cartRule->add(true, false, $categories);
else
@@ -152,13 +152,13 @@ else
$categoriesNames = Tools::truncate(implode(', ', $categoriesNames), 100).'.';
else
$categoriesNames = null;
}
}
$smarty->assign(array(
'nbDiscounts' => (int)$nbDiscounts,
'discounts' => $discounts,
'minimalLoyalty' => (float)Configuration::get('PS_LOYALTY_MINIMAL'),
'categories' => $categoriesNames));
echo Module::display(dirname(__FILE__).'/loyalty.php', 'loyalty.tpl');
echo Module::displayTemplate(dirname(__FILE__).'/loyalty.php', 'loyalty.tpl');
include(dirname(__FILE__).'/../../footer.php');