[*] classes : new module architecture
This commit is contained in:
@@ -162,36 +162,6 @@ class BankWire extends PaymentModule
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
public function execPayment($cart)
|
||||
{
|
||||
return $this->actionPayment(true);
|
||||
}
|
||||
|
||||
public function actionPayment($direct_call = false)
|
||||
{
|
||||
$cart = Context::getContext()->cart;
|
||||
|
||||
if (!$this->active)
|
||||
return;
|
||||
if (!$this->_checkCurrency($cart))
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->getCurrency((int)$cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'this_path' => $this->_path,
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/'
|
||||
));
|
||||
|
||||
if (!$direct_call)
|
||||
return $this->getTemplatePath('payment_execution.tpl');
|
||||
else
|
||||
// For retrocompatibility
|
||||
return $this->display(__FILE__, 'payment_execution.tpl');
|
||||
}
|
||||
|
||||
public function hookPayment($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class BankwirePaymentModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $display_column_left = false;
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$cart = $this->context->cart;
|
||||
if (!$this->module->checkCurrency($cart))
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'this_path' => $this->module->getPathUri(),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
|
||||
));
|
||||
|
||||
$this->setTemplate('payment_execution.tpl');
|
||||
}
|
||||
}
|
||||
+1
-43
@@ -28,22 +28,12 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleBankwireController extends ModuleController
|
||||
class BankwireValidationModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/**
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
if ($this->process == 'validation')
|
||||
$this->processValidation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate bankwire payment
|
||||
*/
|
||||
public function processValidation()
|
||||
{
|
||||
$cart = $this->context->cart;
|
||||
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active)
|
||||
@@ -75,36 +65,4 @@ class ModuleBankwireController extends ModuleController
|
||||
$this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
|
||||
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->process == 'payment')
|
||||
$this->assignPaymentExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign bankwire payment template
|
||||
*/
|
||||
public function assignPaymentExecution()
|
||||
{
|
||||
$cart = $this->context->cart;
|
||||
if (!$this->module->checkCurrency($cart))
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'this_path' => $this->module->getPathUri(),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
|
||||
));
|
||||
|
||||
$this->setTemplate('payment_execution.tpl');
|
||||
}
|
||||
}
|
||||
@@ -21,8 +21,6 @@ $_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'D
|
||||
$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Comme le code banque, l\'IBAN ou encore le BIC';
|
||||
$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Adresse de la banque';
|
||||
$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour';
|
||||
$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Payer par virement bancaire';
|
||||
$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Payer par virement bancaire (traitement plus long)';
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Paiement par virement bancaire';
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande';
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.';
|
||||
@@ -38,6 +36,8 @@ $_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6f
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"';
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
|
||||
$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement';
|
||||
$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Payer par virement bancaire';
|
||||
$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Payer par virement bancaire (traitement plus long)';
|
||||
$_MODULE['<{bankwire}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur';
|
||||
$_MODULE['<{bankwire}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'a bien été enregistrée.';
|
||||
$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Merci de nous envoyer un virement bancaire avec :';
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
/* SSL Management */
|
||||
@@ -39,4 +39,4 @@ Tools::displayFileAsDeprecated();
|
||||
$controller = new FrontController();
|
||||
$controller->init();
|
||||
|
||||
Tools::redirect('index.php?controller=module&module=bankwire&process=payment');
|
||||
Tools::redirect(Context::getContext()->link->getModuleLink('bankwire', 'payment'));
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
|
||||
@@ -10,7 +10,6 @@ $_MODULE['<{blockcontact}prestashop>blockcontact_44a87f7752c32d2d4dba5b25cb2a966
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_02d4482d332e1aef3437cd61c9bcc624'] = 'Contactez-nous';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_6e6a51212bd633f9901a22cea27194d8'] = 'Une conseillère';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_689681c4a40a1e95c35a83771253e8fd'] = 'à votre disposition 24/ 24h';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_6e6c05a143d676b33ca265b0306813fb'] = 'Tél :';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_bbaff12800505b22a853e8b7f4eb6a22'] = 'Contacter';
|
||||
$_MODULE['<{blockcontact}prestashop>blockcontact_e9376117c97ae76d0eefdc3e1f4486e7'] = 'notre conseillère';
|
||||
|
||||
@@ -218,7 +218,7 @@ class Blocknewsletter extends Module
|
||||
// return $this->error = $this->l('E-mail address already registered');
|
||||
|
||||
$email = pSQL($_POST['email']);
|
||||
if (true || !$this->isRegistered($register_status))
|
||||
if (!$this->isRegistered($register_status))
|
||||
{
|
||||
if (Configuration::get('NW_VERIFICATION_EMAIL'))
|
||||
{
|
||||
@@ -451,7 +451,9 @@ class Blocknewsletter extends Module
|
||||
*/
|
||||
protected function sendVerificationEmail($email, $token)
|
||||
{
|
||||
$verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification').'&token='.$token;
|
||||
$verif_url = Context::getContext()->link->getModuleLink('blocknewsletter', 'verification', array(
|
||||
'token' => $token,
|
||||
));
|
||||
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification', $this->context->language->id), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
|
||||
}
|
||||
|
||||
|
||||
+2
-23
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleBlocknewsletterController extends ModuleController
|
||||
class BlocknewsletterVerificationModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
private $message = '';
|
||||
|
||||
@@ -37,18 +37,7 @@ class ModuleBlocknewsletterController extends ModuleController
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = true;
|
||||
if ($this->process == 'verification')
|
||||
$this->processVerification();
|
||||
}
|
||||
|
||||
/**
|
||||
* Process email confirmation
|
||||
*/
|
||||
public function processVerification()
|
||||
{
|
||||
$module = new Blocknewsletter();
|
||||
$this->message = $module->confirmEmail(Tools::getValue('token'));
|
||||
$this->message = $this->module->confirmEmail(Tools::getValue('token'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,17 +47,7 @@ class ModuleBlocknewsletterController extends ModuleController
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->process == 'verification')
|
||||
$this->assignVerificationExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign verification return message
|
||||
*/
|
||||
public function assignVerificationExecution()
|
||||
{
|
||||
$this->context->smarty->assign('message', $this->message);
|
||||
|
||||
$this->setTemplate('verification_execution.tpl');
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ $_MODULE['<{carriercompare}prestashop>carriercompare_fb9e838d470b2c27c2c128d1271
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_b72dd62d03697b37417288c63e78c8c6'] = 'Veuillez utiliser un code postal valide en fonction du pays choisi';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_3f63451bbacbb1c3303d99d0309fdfe9'] = 'Choississez un transporteur';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_efaf5c3827ef576b05de32ad458f196c'] = 'Cet identifiant de transporteur n\'est pas disponible pour cette sélection';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_edc5cf1b3bab64b1d45ef51c63b53887'] = 'Impossibilité de mettre a jour le panier';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_e7a6ca4e744870d455a57b644f696457'] = 'Offert !';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_fbc1bef527a3a092053a244fd8d87abf'] = 'Estimez vos frais de livraison & taxes';
|
||||
$_MODULE['<{carriercompare}prestashop>carriercompare_59716c97497eb9694541f7c3d37b1a4d'] = 'Pays';
|
||||
|
||||
+14
-14
@@ -33,8 +33,8 @@ class Cheque extends PaymentModule
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
|
||||
public $chequeName;
|
||||
public $address;
|
||||
public $chequeName;
|
||||
public $address;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -58,22 +58,22 @@ class Cheque extends PaymentModule
|
||||
$this->description = $this->l('Module for accepting payments by check.');
|
||||
$this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
|
||||
|
||||
if (!isset($this->chequeName) OR !isset($this->address) OR empty($this->chequeName) OR empty($this->address))
|
||||
if (!isset($this->chequeName) || !isset($this->address) || empty($this->chequeName) || empty($this->address))
|
||||
$this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly.');
|
||||
if (!sizeof(Currency::checkPaymentCurrencies($this->id)))
|
||||
if (!count(Currency::checkPaymentCurrencies($this->id)))
|
||||
$this->warning = $this->l('No currency set for this module');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn'))
|
||||
if (!parent::install() || !$this->registerHook('payment') || !$this->registerHook('paymentReturn'))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
if (!Configuration::deleteByName('CHEQUE_NAME') OR !Configuration::deleteByName('CHEQUE_ADDRESS') OR !parent::uninstall())
|
||||
if (!Configuration::deleteByName('CHEQUE_NAME') || !Configuration::deleteByName('CHEQUE_ADDRESS') || !parent::uninstall())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -132,11 +132,11 @@ class Cheque extends PaymentModule
|
||||
if (Tools::isSubmit('btnSubmit'))
|
||||
{
|
||||
$this->_postValidation();
|
||||
if (!sizeof($this->_postErrors))
|
||||
if (!count($this->_postErrors))
|
||||
$this->_postProcess();
|
||||
else
|
||||
foreach ($this->_postErrors AS $err)
|
||||
$this->_html .= '<div class="alert error">'. $err .'</div>';
|
||||
foreach ($this->_postErrors as $err)
|
||||
$this->_html .= '<div class="alert error">'.$err.'</div>';
|
||||
}
|
||||
else
|
||||
$this->_html .= '<br />';
|
||||
@@ -150,9 +150,9 @@ class Cheque extends PaymentModule
|
||||
public function hookPayment($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
return ;
|
||||
return;
|
||||
if (!$this->checkCurrency($params['cart']))
|
||||
return ;
|
||||
return;
|
||||
|
||||
$this->smarty->assign(array(
|
||||
'this_path' => $this->_path,
|
||||
@@ -164,10 +164,10 @@ class Cheque extends PaymentModule
|
||||
public function hookPaymentReturn($params)
|
||||
{
|
||||
if (!$this->active)
|
||||
return ;
|
||||
return;
|
||||
|
||||
$state = $params['objOrder']->getCurrentState();
|
||||
if ($state == Configuration::get('PS_OS_CHEQUE') OR $state == Configuration::get('PS_OS_OUTOFSTOCK'))
|
||||
if ($state == Configuration::get('PS_OS_CHEQUE') || $state == Configuration::get('PS_OS_OUTOFSTOCK'))
|
||||
{
|
||||
$this->smarty->assign(array(
|
||||
'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
|
||||
@@ -190,7 +190,7 @@ class Cheque extends PaymentModule
|
||||
$currencies_module = $this->getCurrency((int)$cart->id_currency);
|
||||
|
||||
if (is_array($currencies_module))
|
||||
foreach ($currencies_module AS $currency_module)
|
||||
foreach ($currencies_module as $currency_module)
|
||||
if ($currency_order->id == $currency_module['id_currency'])
|
||||
return true;
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ChequePaymentModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $display_column_left = false;
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
$cart = $this->context->cart;
|
||||
if (!$this->module->checkCurrency($cart))
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'isoCode' => $this->context->language->iso_code,
|
||||
'chequeName' => $this->module->chequeName,
|
||||
'chequeAddress' => Tools::nl2br($this->module->address),
|
||||
'this_path' => $this->module->getPathUri(),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
|
||||
));
|
||||
|
||||
$this->setTemplate('payment_execution.tpl');
|
||||
}
|
||||
}
|
||||
+1
-49
@@ -28,22 +28,9 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleChequeController extends ModuleController
|
||||
class ChequeValidationModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/**
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
if ($this->process == 'validation')
|
||||
$this->processValidation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate cheque payment
|
||||
*/
|
||||
public function processValidation()
|
||||
{
|
||||
$cart = $this->context->cart;
|
||||
|
||||
@@ -78,39 +65,4 @@ class ModuleChequeController extends ModuleController
|
||||
$this->module->validateOrder((int)$cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
|
||||
Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.(int)$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if ($this->process == 'payment')
|
||||
$this->assignPaymentExecution();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign cheque payment template
|
||||
*/
|
||||
public function assignPaymentExecution()
|
||||
{
|
||||
$cart = $this->context->cart;
|
||||
if (!$this->module->checkCurrency($cart))
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'isoCode' => $this->context->language->iso_code,
|
||||
'chequeName' => $this->module->chequeName,
|
||||
'chequeAddress' => Tools::nl2br($this->module->address),
|
||||
'this_path' => $this->module->getPathUri(),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
|
||||
));
|
||||
|
||||
$this->setTemplate('payment_execution.tpl');
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
/* SSL Management */
|
||||
@@ -39,4 +39,4 @@ Tools::displayFileAsDeprecated();
|
||||
$controller = new FrontController();
|
||||
$controller->init();
|
||||
|
||||
Tools::redirect('index.php?controller=module&module=cheque&process=payment');
|
||||
Tools::redirect(Context::getContext()->link->getModuleLink('cheque', 'payment'));
|
||||
@@ -19,8 +19,6 @@ $_MODULE['<{cheque}prestashop>cheque_d75e7b0f61c58d5d1cef7b56322c8b21'] = 'Merci
|
||||
$_MODULE['<{cheque}prestashop>cheque_75475839e69bef6ed57a8200a5a71d37'] = 'A l\'ordre de';
|
||||
$_MODULE['<{cheque}prestashop>cheque_dd7bf230fde8d4836917806aff6a6b27'] = 'Adresse';
|
||||
$_MODULE['<{cheque}prestashop>cheque_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour';
|
||||
$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Payer par chèque';
|
||||
$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Payer par chèque (traitement plus long)';
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_83aa0e5744c86bf2d9d006319db14839'] = 'Paiement par chèque';
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande';
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.';
|
||||
@@ -36,6 +34,8 @@ $_MODULE['<{cheque}prestashop>payment_execution_504be670f962fa7630863857a0085632
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Merci de confirmer votre commande en cliquant sur \"Je confirme ma commande\"';
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
|
||||
$_MODULE['<{cheque}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement';
|
||||
$_MODULE['<{cheque}prestashop>payment_a5967aadef7d23b5027d46e107faf6d0'] = 'Payer par chèque';
|
||||
$_MODULE['<{cheque}prestashop>payment_30bee0e9549e97b2f65f8fd8fc5948be'] = 'Payer par chèque (traitement plus long)';
|
||||
$_MODULE['<{cheque}prestashop>payment_return_2e2117b7c81aa9ea6931641ea2c6499f'] = 'Votre commande sur';
|
||||
$_MODULE['<{cheque}prestashop>payment_return_75fbf512d744977d62599cc3f0ae2bb4'] = 'est bien enregistrée.';
|
||||
$_MODULE['<{cheque}prestashop>payment_return_e4ee6e0eac588fe2611cc6fd195828af'] = 'Merci de nous envoyer un chèque :';
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
include(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@
|
||||
{else}
|
||||
|
||||
<h3>{l s='Cheque payment' mod='cheque'}</h3>
|
||||
<form action="{$link->getModuleLink('cheque', 'validation', true)}" method="post">
|
||||
<form action="{$link->getModuleLink('cheque', 'validation', [], true)}" method="post">
|
||||
<p>
|
||||
<img src="{$this_path}cheque.jpg" alt="{l s='cheque' mod='cheque'}" width="86" height="49" style="float:left; margin: 0px 10px 5px 0px;" />
|
||||
{l s='You have chosen to pay by cheque.' mod='cheque'}
|
||||
@@ -25,7 +25,7 @@
|
||||
*}
|
||||
|
||||
<p class="payment_module">
|
||||
<a href="{$link->getModuleLink('cheque', 'payment', true)}" title="{l s='Pay by cheque' mod='cheque'}">
|
||||
<a href="{$link->getModuleLink('cheque', 'payment', [], true)}" title="{l s='Pay by cheque' mod='cheque'}">
|
||||
<img src="{$this_path}cheque.jpg" alt="{l s='Pay by cheque' mod='cheque'}" width="86" height="49" />
|
||||
{l s='Pay by cheque (order process will be longer)' mod='cheque'}
|
||||
</a>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class FavoriteproductsAccountModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
require_once($this->module->getLocalPath().'FavoriteProduct.php');
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=auth&redirect=module&module=favoriteproducts&action=account');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
{
|
||||
$this->context->smarty->assign('favoriteProducts', FavoriteProduct::getFavoriteProducts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
$this->setTemplate('favoriteproducts-account.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
-26
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModuleFavoriteproductsController extends ModuleController
|
||||
class FavoriteproductsActionsModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
@@ -39,16 +39,17 @@ class ModuleFavoriteproductsController extends ModuleController
|
||||
{
|
||||
parent::init();
|
||||
|
||||
require_once(dirname(__FILE__).'/FavoriteProduct.php');
|
||||
require_once($this->module->getLocalPath().'FavoriteProduct.php');
|
||||
$this->id_product = (int)Tools::getValue('id_product');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if ($this->process == 'remove')
|
||||
if (Tools::getValue('process') == 'remove')
|
||||
$this->processRemove();
|
||||
else if ($this->process == 'add')
|
||||
else if (Tools::getValue('process') == 'add')
|
||||
$this->processAdd();
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,26 +85,4 @@ class ModuleFavoriteproductsController extends ModuleController
|
||||
die('0');
|
||||
die(1);
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
if ($this->process == 'account')
|
||||
$this->assignAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare account page
|
||||
*/
|
||||
public function assignAccount()
|
||||
{
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=auth&redirect=module&module=favoriteproducts&action=account');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
{
|
||||
$this->context->smarty->assign('favoriteProducts', FavoriteProduct::getFavoriteProducts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
$this->setTemplate('favoriteproducts-account.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
/* SSL Management */
|
||||
@@ -39,4 +39,4 @@ Tools::displayFileAsDeprecated();
|
||||
$controller = new FrontController();
|
||||
$controller->init();
|
||||
|
||||
Tools::redirect('index.php?controller=module&module=favoriteproducts&process=account');
|
||||
Tools::redirect(Context::getContext()->link->getModuleLink('favoriteproducts', 'account'));
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleController instead
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../config/config.inc.php');
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts_c249aeb21294d5e97598462b550e73eb'] = 'Produits Favoris';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts_0db149d6f1284b51aa48c72dd1b0e7c6'] = 'Affiche une page avec les produits favoris de l\'utilisateur';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-account_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-account_a34e0796b9c15d09300f67d972379722'] = 'Mes produits favoris';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-account_e2233f8a7cec20324ed48bc32ec98a5d'] = 'Vous ne possédez pas de produit favoris pour le moment';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-account_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-extra_77b65985b439ff157c1c13d63c9dc294'] = 'Ajouter ce produit à mes favoris';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts-extra_84934524b3493305f6faf3074258b512'] = 'Retirer ce produit de mes favoris';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts_c249aeb21294d5e97598462b550e73eb'] = 'Produits Favoris';
|
||||
$_MODULE['<{favoriteproducts}prestashop>favoriteproducts_0db149d6f1284b51aa48c72dd1b0e7c6'] = 'Affiche une page avec les produits favoris de l\'utilisateur';
|
||||
$_MODULE['<{favoriteproducts}prestashop>my-account_a34e0796b9c15d09300f67d972379722'] = 'Mes produits favoris';
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ $('document').ready(function()
|
||||
var parent = $(this).parent().parent();
|
||||
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'remove')}",
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
'id_product': idFavoriteProduct
|
||||
+4
-4
@@ -28,7 +28,7 @@
|
||||
$('document').ready(function(){
|
||||
$('#favoriteproducts_block_extra_add').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'add')}",
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'actions', ['process' => 'add'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -46,7 +46,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#favoriteproducts_block_extra_remove').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'remove')}",
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -64,7 +64,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#favoriteproducts_block_extra_added').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'remove')}",
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -82,7 +82,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#favoriteproducts_block_extra_removed').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'add')}",
|
||||
url: "{$link->getModuleLink('favoriteproducts', 'actions', ['process' => 'add'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
+25
-22
@@ -28,21 +28,24 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
||||
include_once(dirname(__FILE__).'/LoyaltyModule.php');
|
||||
include_once(dirname(__FILE__).'/LoyaltyStateModule.php');
|
||||
|
||||
class ModuleLoyaltyController extends ModuleController
|
||||
class LoyaltyDefaultModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
protected $page_name = 'module-loyalty-loyalty-program';
|
||||
public $display_column_left = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
include_once($this->module->getLocalPath().'LoyaltyModule.php');
|
||||
include_once($this->module->getLocalPath().'LoyaltyStateModule.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* @see FrontController::postProcess()
|
||||
*/
|
||||
public function postProcess()
|
||||
{
|
||||
$this->display_column_left = false;
|
||||
if ($this->process == 'transformpoints')
|
||||
if (Tools::getValue('process') == 'transformpoints')
|
||||
$this->processTransformPoints();
|
||||
}
|
||||
|
||||
@@ -51,16 +54,16 @@ class ModuleLoyaltyController extends ModuleController
|
||||
*/
|
||||
public function processTransformPoints()
|
||||
{
|
||||
$customerPoints = (int)(LoyaltyModule::getPointsByCustomer((int)($this->context->customer->id)));
|
||||
$customerPoints = (int)LoyaltyModule::getPointsByCustomer((int)$this->context->customer->id);
|
||||
if ($customerPoints > 0)
|
||||
{
|
||||
/* Generate a voucher code */
|
||||
$voucherCode = NULL;
|
||||
$voucherCode = null;
|
||||
do
|
||||
$voucherCode = 'FID'.rand(1000, 100000);
|
||||
while (CartRule::cartRuleExists($voucherCode));
|
||||
|
||||
/* Voucher creation and affectation to the customer */
|
||||
// Voucher creation and affectation to the customer
|
||||
$cartRule = new CartRule();
|
||||
$cartRule->code = $voucherCode;
|
||||
$cartRule->id_customer = (int)$this->context->cookie->id_customer;
|
||||
@@ -69,7 +72,7 @@ class ModuleLoyaltyController extends ModuleController
|
||||
$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
|
||||
@@ -86,7 +89,7 @@ class ModuleLoyaltyController extends ModuleController
|
||||
$cartRule->active = 1;
|
||||
|
||||
$categories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY');
|
||||
if ($categories != '' AND $categories != 0)
|
||||
if ($categories != '' && $categories != 0)
|
||||
$categories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
|
||||
else
|
||||
die (Tools::displayError());
|
||||
@@ -94,21 +97,21 @@ class ModuleLoyaltyController extends ModuleController
|
||||
$languages = Language::getLanguages(true);
|
||||
$default_text = Configuration::get('PS_LOYALTY_VOUCHER_DETAILS', (int)Configuration::get('PS_LANG_DEFAULT'));
|
||||
|
||||
foreach ($languages AS $language)
|
||||
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))
|
||||
if (is_array($categories) && count($categories))
|
||||
$cartRule->add(true, false, $categories);
|
||||
else
|
||||
$cartRule->add();
|
||||
|
||||
/* Register order(s) which contributed to create this voucher */
|
||||
// Register order(s) which contributed to create this voucher
|
||||
LoyaltyModule::registerDiscount($cartRule);
|
||||
|
||||
Tools::redirect($this->context->link->getModuleLink('loyalty', 'summary'));
|
||||
Tools::redirect($this->context->link->getModuleLink('loyalty', 'default'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +123,7 @@ class ModuleLoyaltyController extends ModuleController
|
||||
parent::initContent();
|
||||
$this->context->controller->addJqueryPlugin(array('dimensions', 'cluetip'));
|
||||
|
||||
if ($this->process == 'summary')
|
||||
if (Tools::getValue('process') == 'summary')
|
||||
$this->assignSummaryExecution();
|
||||
}
|
||||
|
||||
@@ -135,7 +138,7 @@ class ModuleLoyaltyController extends ModuleController
|
||||
$this->context->smarty->assign(array(
|
||||
'orders' => $orders,
|
||||
'displayorders' => $displayorders,
|
||||
'pagination_link' => $this->context->link->getModuleLink('loyalty', 'summary'),
|
||||
'pagination_link' => $this->context->link->getModuleLink('loyalty', 'default'),
|
||||
'totalPoints' => (int)$customerPoints,
|
||||
'voucher' => LoyaltyModule::getVoucherValue($customerPoints, (int)($this->context->cookie->id_currency)),
|
||||
'validation_id' => LoyaltyStateModule::getValidationId(),
|
||||
@@ -152,7 +155,7 @@ class ModuleLoyaltyController extends ModuleController
|
||||
if ($ids_discount = LoyaltyModule::getDiscountByIdCustomer((int)$this->context->cookie->id_customer))
|
||||
{
|
||||
$nbDiscounts = count($ids_discount);
|
||||
foreach ($ids_discount AS $key => $discount)
|
||||
foreach ($ids_discount as $key => $discount)
|
||||
{
|
||||
$discounts[$key] = new CartRule((int)$discount['id_cart_rule'], (int)$this->context->cookie->id_lang);
|
||||
$discounts[$key]->orders = LoyaltyModule::getOrdersByIdDiscount((int)$discount['id_cart_rule']);
|
||||
@@ -161,12 +164,12 @@ class ModuleLoyaltyController extends ModuleController
|
||||
|
||||
$allCategories = Category::getSimpleCategories((int)($this->context->cookie->id_lang));
|
||||
$voucherCategories = Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY');
|
||||
if ($voucherCategories != '' AND $voucherCategories != 0)
|
||||
if ($voucherCategories != '' && $voucherCategories != 0)
|
||||
$voucherCategories = explode(',', Configuration::get('PS_LOYALTY_VOUCHER_CATEGORY'));
|
||||
else
|
||||
die(Tools::displayError());
|
||||
|
||||
if (sizeof($voucherCategories) == sizeof($allCategories))
|
||||
if (count($voucherCategories) == count($allCategories))
|
||||
$categoriesNames = null;
|
||||
else
|
||||
{
|
||||
@@ -24,12 +24,6 @@ $_MODULE['<{loyalty}prestashop>loyalty_bafd7322c6e97d25b6299b5d6fe8920b'] = 'Non
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_ade45d72ab6ba1ab576d8b9deb0c2438'] = 'Points attribués au statut suivant';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_9611a682e61c503c32e2dc58fdbc8ddf'] = 'Points annulés au statut suivant';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_2a46cccdea2f18fdfdfacf99a98b758d'] = 'Les bons de réductions crées par le système de fidélité peuvent être utilisés dans les catégories d\'articles suivantes :';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_ef7de3f485174ff47f061ad27d83d0ee'] = 'sélectionné';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_b56c3bda503a8dc4be356edb0cc31793'] = 'Réduire tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_5ffd7a335dd836b3373f5ec570a58bdc'] = 'Ouvrir tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_5e9df908eafa83cb51c0a3720e8348c7'] = 'Cocher tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_9747d23c8cc358c5ef78c51e59cd6817'] = 'Décocher tout';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_c2a7db7dec4de1bdb143ccd790f5a62c'] = 'Cocher pour quelle(s) catégorie(s) seront utilisables les bons de réductions fidélité';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_30e793698766edbaaf84a74d4c377f72'] = 'Statuts des points de fidélité';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_4f2a91e15af2631ff9424564b8a45fb2'] = 'Initial';
|
||||
@@ -84,6 +78,7 @@ $_MODULE['<{loyalty}prestashop>loyalty_a16cf3ec5200cc519f4fe48e34b1df83'] = 'Le
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_8e69341aca5dbf9f55c2e75a2ed5df3c'] = 'Aucun bon de réduction pour le moment.';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_00d56a5e37c19c59d521530fc8e7f337'] = 'Aucun point de fidélité pour le moment.';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte';
|
||||
$_MODULE['<{loyalty}prestashop>loyalty_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_MODULE['<{loyalty}prestashop>my-account_c540093e64d84440025b2d8201f04336'] = 'Mes points de fidélité';
|
||||
$_MODULE['<{loyalty}prestashop>product_08ef6b34ab8e7039ef0ee69378f0ac0b'] = 'En achetant ce produit vous pouvez gagner jusqu\'à ';
|
||||
$_MODULE['<{loyalty}prestashop>product_2996152bb442bf98c80c515c6055de5f'] = 'points de fidélité';
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
{if $transformation_allowed}
|
||||
<p style="text-align:center; margin-top:20px">
|
||||
<a href="{$link->getModuleLink('loyalty', 'transformpoints')}" onclick="return confirm('{l s='Are you sure you want to transform your points into vouchers?' mod='loyalty' js=1}');">{l s='Transform my points into a voucher of' mod='loyalty'} <span class="price">{convertPrice price=$voucher}</span>.</a>
|
||||
<a href="{$link->getModuleLink('loyalty', 'default', ['process' => 'transformpoints'])}" onclick="return confirm('{l s='Are you sure you want to transform your points into vouchers?' mod='loyalty' js=1}');">{l s='Transform my points into a voucher of' mod='loyalty'} <span class="price">{convertPrice price=$voucher}</span>.</a>
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
+1
-1
@@ -25,5 +25,5 @@
|
||||
*}
|
||||
|
||||
<!-- MODULE Loyalty -->
|
||||
<li class="loyalty"><a href="{$link->getModuleLink('loyalty', 'summary')}" title="{l s='My loyalty points' mod='loyalty'}"><img src="{$module_template_dir}images/loyalty.gif" alt="{l s='My loyalty points' mod='loyalty'}" class="icon" /> {l s='My loyalty points' mod='loyalty'}</a></li>
|
||||
<li class="loyalty"><a href="{$link->getModuleLink('loyalty', 'default', ['process' => 'summary'])}" title="{l s='My loyalty points' mod='loyalty'}"><img src="{$module_template_dir}images/loyalty.gif" alt="{l s='My loyalty points' mod='loyalty'}" class="icon" /> {l s='My loyalty points' mod='loyalty'}</a></li>
|
||||
<!-- END : MODULE Loyalty -->
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class MailalertsAccountModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
require_once($this->module->getLocalPath().'MailAlert.php');
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=auth&redirect=account&module=mailalerts&fc=module');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
{
|
||||
$this->context->smarty->assign('id_customer', Context::getContext()->customer->id);
|
||||
$this->context->smarty->assign('mailAlerts', MailAlert::getMailAlerts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
|
||||
$this->setTemplate('mailalerts-account.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-30
@@ -20,7 +20,7 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2011 PrestaShop SA
|
||||
* @version Release: $Revision: 11894 $
|
||||
* @version Release: $Revision$
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
@@ -28,7 +28,7 @@
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class ModulemailalertsController extends ModuleController
|
||||
class MailalertsActionsModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
@@ -39,17 +39,17 @@ class ModulemailalertsController extends ModuleController
|
||||
{
|
||||
parent::init();
|
||||
|
||||
require_once(dirname(__FILE__).'/MailAlert.php');
|
||||
require_once($this->module->getLocalPath().'MailAlert.php');
|
||||
$this->id_product = (int)Tools::getValue('id_product');
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if ($this->process == 'remove')
|
||||
if (Tools::getValue('process') == 'remove')
|
||||
$this->processRemove();
|
||||
else if ($this->process == 'add')
|
||||
else if (Tools::getValue('process') == 'add')
|
||||
$this->processAdd();
|
||||
else if ($this->process == 'check')
|
||||
else if (Tools::getValue('process') == 'check')
|
||||
$this->processCheck();
|
||||
}
|
||||
|
||||
@@ -133,28 +133,4 @@ class ModulemailalertsController extends ModuleController
|
||||
|
||||
die('0');
|
||||
}
|
||||
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
if ($this->process == 'account')
|
||||
$this->assignAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare account page
|
||||
*/
|
||||
public function assignAccount()
|
||||
{
|
||||
if (!Context::getContext()->customer->isLogged())
|
||||
Tools::redirect('index.php?controller=auth&redirect=module&module=mailalerts&action=account');
|
||||
|
||||
if (Context::getContext()->customer->id)
|
||||
{
|
||||
$this->context->smarty->assign('id_customer', Context::getContext()->customer->id);
|
||||
$this->context->smarty->assign('mailAlerts', MailAlert::getMailAlerts((int)Context::getContext()->customer->id, (int)Context::getContext()->language->id));
|
||||
|
||||
$this->setTemplate('mailalerts-account.tpl');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,6 @@
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mes alertes';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_deb10517653c255364175796ace3553f'] = 'Produit';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_074c07016d3e5a9f011aa8e62abe4517'] = 'Vous n\'êtes inscris à aucune alerte.';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_8bb23c2ae698681ebb650f43acb54dab'] = 'Aucune alerte mail.';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_fd30254803e8db32521d3390131a44da'] = 'Alertes email';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_2d51f4a7ab8a12c4f35b507019523b8c'] = 'Envoie des notifications par e-mail aux clients et aux marchands.';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_8fd3b84964bd6dfec8095f658d200b29'] = 'Etes-vous sûr de vouloir supprimer toutes les notifications clients ?';
|
||||
@@ -33,6 +25,14 @@ $_MODULE['<{mailalerts}prestashop>mailalerts_f77ed609e48d550f0166dfbafc102710']
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_7cb9a154f101c674c945f88dad5c5e28'] = 'Aucun message';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_9137796c15dd92e5553c3f29574d0968'] = 'Code de réduction :';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts_4c9120f1a5947445c0e9620254ceb30b'] = 'Nouvelle commande';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_d95cf4ab2cbf1dfb63f066b50558b07d'] = 'Mon compte';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mes alertes';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_deb10517653c255364175796ace3553f'] = 'Produit';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_074c07016d3e5a9f011aa8e62abe4517'] = 'Vous n\'êtes inscris à aucune alerte.';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_0b3db27bc15f682e92ff250ebb167d4b'] = 'Retour à votre compte';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_8cf04a9734132302f96da8e113e80ce5'] = 'Accueil';
|
||||
$_MODULE['<{mailalerts}prestashop>mailalerts-account_8bb23c2ae698681ebb650f43acb54dab'] = 'Aucune alerte mail.';
|
||||
$_MODULE['<{mailalerts}prestashop>my-account_4edfd10d0bb5f51e0fd2327df608b5a8'] = 'Mes alertes';
|
||||
$_MODULE['<{mailalerts}prestashop>product_67135a14d3ac4f1369633dd006d6efec'] = 'votre@email.com';
|
||||
$_MODULE['<{mailalerts}prestashop>product_61172eb93737ebf095d3fa02119ce1df'] = 'Demande de notification enregistrée';
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
$('document').ready(function(){
|
||||
$('#mailalerts_block_extra_add').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('mailalerts', 'add')}",
|
||||
url: "{$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -46,7 +46,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#mailalerts_block_extra_remove').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('mailalerts', 'remove')}",
|
||||
url: "{$link->getModuleLink('mailalerts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -64,7 +64,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#mailalerts_block_extra_added').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('mailalerts', 'remove')}",
|
||||
url: "{$link->getModuleLink('mailalerts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
@@ -82,7 +82,7 @@ $('document').ready(function(){
|
||||
});
|
||||
$('#mailalerts_block_extra_removed').click(function(){
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('mailalerts', 'add')}",
|
||||
url: "{$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
"id_product": {$smarty.get.id_product}
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ $('document').ready(function()
|
||||
var parent = $(this).parent().parent();
|
||||
|
||||
$.ajax({
|
||||
url: "{$link->getModuleLink('mailalerts', 'remove')}",
|
||||
url: "{$link->getModuleLink('mailalerts', 'actions', ['process' => 'remove'])}",
|
||||
type: "POST",
|
||||
data: {
|
||||
'id_product': idMailAlert
|
||||
+2
-2
@@ -35,7 +35,7 @@ function clearText() {
|
||||
function oosHookJsCodeMailAlert() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{/literal}{$link->getModuleLink('mailalerts', 'check')}{literal}",
|
||||
url: "{/literal}{$link->getModuleLink('mailalerts', 'actions', ['process' => 'check'])}{literal}",
|
||||
data: 'id_product={/literal}{$id_product}{literal}&id_product_attribute='+$('#idCombination').val(),
|
||||
success: function (msg) {
|
||||
if (msg == '0') {
|
||||
@@ -53,7 +53,7 @@ function oosHookJsCodeMailAlert() {
|
||||
function addNotification() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "{/literal}{$link->getModuleLink('mailalerts', 'add')}{literal}",
|
||||
url: "{/literal}{$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])}{literal}",
|
||||
data: 'id_product={/literal}{$id_product}{literal}&id_product_attribute='+$('#idCombination').val()+'&customer_email='+$('#oos_customer_email').val()+'',
|
||||
success: function (msg) {
|
||||
if (msg == '1') {
|
||||
Reference in New Issue
Block a user