switcher always visible, but postpaid option only if in postpaid customer group. Removed inline style
This commit is contained in:
@@ -316,16 +316,19 @@ class B2BPayments extends PaymentModule implements PrestaShop\PrestaShop\Core\Mo
|
||||
{
|
||||
$customer = $this->context->customer;
|
||||
|
||||
$group_ids = Customer::getGroupsStatic((int)$customer->id);
|
||||
|
||||
$postpaid_group_id = (int)Configuration::get('B2BPAYMENTS_POSTPAID_GROUP');
|
||||
$prepaid_group_id = (int)Configuration::get('B2BPAYMENTS_PREPAID_GROUP');
|
||||
|
||||
if ($customer->isLogged() && $this->isCustomerInGroup($customer->id, $postpaid_group_id) && $this->isCustomerInGroup($customer->id, $prepaid_group_id)) {
|
||||
if ($customer->isLogged() /*&& $this->isCustomerInGroup($customer->id, $postpaid_group_id)*/ && $this->isCustomerInGroup($customer->id, $prepaid_group_id)) {
|
||||
return array(
|
||||
'show_switch' => true,
|
||||
'postpaid_group_id' => $postpaid_group_id,
|
||||
'prepaid_group_id' => $prepaid_group_id,
|
||||
'current_group_is_postpaid' => $this->isDefaultCustomerGroup($customer->id, $postpaid_group_id),
|
||||
'switch_url' => $this->context->link->getModuleLink($this->name, 'switch', array(), true)
|
||||
'switch_url' => $this->context->link->getModuleLink($this->name, 'switch', array(), true),
|
||||
'customer_groups' => $group_ids
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user