[*] Core: you can now associate modules to order states in order to add extra mail vars

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16618 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-07-31 09:18:41 +00:00
parent 58f7fb1c03
commit b37a36eba5
9 changed files with 41 additions and 18 deletions
+7 -1
View File
@@ -36,7 +36,7 @@ class BankWire extends PaymentModule
public $details;
public $owner;
public $address;
public $extra_mail_vars;
public function __construct()
{
$this->name = 'bankwire';
@@ -64,6 +64,12 @@ class BankWire extends PaymentModule
$this->warning = $this->l('Account owner and details must be configured in order to use this module correctly.');
if (!count(Currency::checkPaymentCurrencies($this->id)))
$this->warning = $this->l('No currency set for this module');
$this->extra_mail_vars = array(
'{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
'{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
'{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
);
}
public function install()
+2 -6
View File
@@ -58,12 +58,8 @@ if (!Validate::isLoadedObject($customer))
$currency = $context->currency;
$total = (float)($cart->getOrderTotal(true, Cart::BOTH));
$mailVars = array(
'{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
'{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
'{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
);
$bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
$bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key);
$order = new Order($bankwire->currentOrder);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key);
+7
View File
@@ -35,6 +35,7 @@ class Cheque extends PaymentModule
public $chequeName;
public $address;
public $extra_mail_vars;
public function __construct()
{
@@ -62,6 +63,12 @@ class Cheque extends PaymentModule
$this->warning = $this->l('\'To the order of\' and address must be configured in order to use this module correctly.');
if (!count(Currency::checkPaymentCurrencies($this->id)))
$this->warning = $this->l('No currency set for this module');
$this->extra_mail_vars = array(
'{cheque_name}' => Configuration::get('CHEQUE_NAME'),
'{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'),
'{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS'))
);
}
public function install()
+1 -6
View File
@@ -61,12 +61,7 @@ if (!Validate::isLoadedObject($customer))
$currency = $context->currency;
$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
$mailVars = array(
'{cheque_name}' => Configuration::get('CHEQUE_NAME'),
'{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'),
'{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
$cheque->validateOrder((int)$cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $cheque->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
$cheque->validateOrder((int)$cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $cheque->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)($cart->id).'&id_module='.(int)($cheque->id).'&id_order='.$cheque->currentOrder.'&key='.$customer->secure_key);