Post by Pamella » Sun May 09, 2021 6:17 am

Hi, tried to restrict C.O.D. payment method (for exemple) to our customer group n°2

catalog/model/extension/payment/cod.php

Code: Select all

      $customer_group_id = $this->customer->getCustomerGroupId();
      if ($customer_group_id == 2 ) {

Code: Select all

		if ($this->config->get('payment_cod_total') > 0 && $this->config->get('payment_cod_total') > $total) {
			$status = false;
		} elseif (!$this->cart->hasShipping()) {
			$status = false;
		} elseif (!$this->config->get('payment_cod_geo_zone_id')) {
			$status = true;
		} elseif ($query->num_rows) {
			$status = true;
		} else {
			$status = false;
		}

Code: Select all

      } else  {
         $status = false;
      }
It seems something need to be updated since our outdated OC v1 ;) any idea 'll be welcomed? many thanks in advance
Last edited by Pamella on Mon May 10, 2021 2:09 am, edited 1 time in total.

OC 3.0.3.7 EN (default theme) running on PHP 7.3 MariaDB 10.3 Linux / Apache 2.4


New member

Posts

Joined
Tue Oct 25, 2011 4:22 am

Post by WXHosting » Sun May 09, 2021 4:09 pm

Hi Pam,

Just change it to $this->customer->getGroupId() and you should be good to go!

Image


Newbie

Posts

Joined
Sun May 09, 2021 4:06 pm

Post by Pamella » Sun May 09, 2021 11:43 pm

Many thank to @WXHosting for this reply ;) even on sunday! all seem right for now...

OC 3.0.3.7 EN (default theme) running on PHP 7.3 MariaDB 10.3 Linux / Apache 2.4


New member

Posts

Joined
Tue Oct 25, 2011 4:22 am
Who is online

Users browsing this forum: Bing [Bot], jagall, moreduff and 261 guests