Compare commits
2 Commits
b721c153fb
...
5227a50e01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5227a50e01 | ||
|
|
7458f80c53 |
@@ -44,8 +44,9 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo
|
||||
{
|
||||
if (
|
||||
!parent::install() ||
|
||||
!$this->registerHook('paymentOptions')
|
||||
|| !$this->registerHook('DisplayOrderConfirmation')
|
||||
!$this->registerHook('paymentOptions') ||
|
||||
!$this->registerHook('DisplayOrderConfirmation') ||
|
||||
!$this->registerHook('actionEmailSendBefore')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -411,4 +412,13 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo
|
||||
Context::getContext()->customer = $originalCustomer;
|
||||
return $regularPrice;
|
||||
}
|
||||
|
||||
public function hookActionEmailSendBefore($params)
|
||||
{
|
||||
if ($params['template'] == 'bankwire_postpaid') {
|
||||
$params['templateVars']['{bankwire_owner}'] = Configuration::get('BANK_WIRE_OWNER');
|
||||
$params['templateVars']['{bankwire_details}'] = nl2br(Configuration::get('BANK_WIRE_DETAILS'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,9 +36,11 @@ class B2BPaymentsValidationModuleFrontController extends ModuleFrontController
|
||||
$this->context->customer->id;
|
||||
$b2b_postpaid_group_id = (int)Configuration::get('B2BPAYMENTS_POSTPAID_GROUP');
|
||||
$b2b_prepaid_group_id = (int)Configuration::get('B2BPAYMENTS_PREPAID_GROUP');
|
||||
$payment_status = Configuration::get('PS_OS_PAYMENT'); // Default: Payment accepted
|
||||
//$payment_status = Configuration::get('PS_OS_PAYMENT'); // Default: Payment accepted
|
||||
$payment_status = Configuration::get('PS_OS_BANKWIRE'); // Default for Prepaid: Awaiting payment via IBAN
|
||||
if ($this->module->isDefaultCustomerGroup($this->context->customer->id, $b2b_postpaid_group_id) && $this->module->isCustomerInGroup($this->context->customer->id, $b2b_postpaid_group_id)) {
|
||||
$payment_status = Configuration::get('PS_OS_PREPARATION'); // Order processing in progress. Adjust as needed.
|
||||
//$payment_status = Configuration::get('PS_OS_PREPARATION'); // Order processing in progress. Adjust as needed.
|
||||
$payment_status = 15; // Fod Postpaid: Awaiting to process order (custom status ID: 15)
|
||||
$payment_method = $this->module->b2b_postpaid_payment_name;
|
||||
} else if ($this->module->isDefaultCustomerGroup($this->context->customer->id, $b2b_prepaid_group_id) && $this->module->isCustomerInGroup($this->context->customer->id, $b2b_prepaid_group_id)) {
|
||||
//Payment Status Already fine.
|
||||
|
||||
Reference in New Issue
Block a user