Page 1 of 1

Hide Paypal Express if currency INR?

Posted: Tue Sep 02, 2014 12:05 pm
by dharam81
Hi,

as paypal dont support INR so how to hide paypal express checkout option if store currency is INR?

dk

Re: Hide Paypal Express if currency INR?

Posted: Tue Sep 02, 2014 3:46 pm
by pprmkr
Edit catalog/model/payment/pp_express.php

Before:

Code: Select all

$method_data = array();
Add:

Code: Select all

		if($this->currency->getCode() == 'INR') {
			$status = false;
		}

Re: Hide Paypal Express if currency INR?

Posted: Tue Sep 02, 2014 4:08 pm
by dharam81
pprmkr wrote:Edit catalog/model/payment/pp_express.php

Before:

Code: Select all

$method_data = array();
Add:

Code: Select all

		if($this->currency->getCode() == 'INR') {
			$status = false;
		}
Hi, i tried exactly but get below error on checkout page.

if ($this->config->get('pp_express_total') > $total) {
$status = false;
} elseif (!$this->config->get('pp_express_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} elseif ($this->currency->getCode() = 'INR') {
$status = FALSE;
} else {
$status = false;
}

$method_data = array();



Fatal error: Can't use method return value in write context in /home/public_html/catalog/model/payment/pp_express.php on line 92

Re: Hide Paypal Express if currency INR?

Posted: Tue Sep 02, 2014 4:47 pm
by pprmkr
Where did I mention:

Code: Select all

} elseif ($this->currency->getCode() = 'INR') {
$status = FALSE;
You cannot set any value on the function getCode() !
I did not instruct to use elseif !

Just follow my instruction and put the lines:

Code: Select all

      if($this->currency->getCode() == 'INR') {
         $status = false;
      }
Before:

Code: Select all

$method_data = array();

Re: Hide Paypal Express if currency INR?

Posted: Thu Sep 04, 2014 4:52 am
by dharam81
thanks pprmkr

its working now.

you are star :)

Re: Hide Paypal Express if currency INR?

Posted: Mon Aug 06, 2018 9:55 pm
by tahirshoukat
Hi, i tried exactly but get below error on checkout page.

if ($this->config->get('pp_express_total') > $total) {
$status = false;
} elseif (!$this->config->get('pp_express_geo_zone_id')) {
$status = true;
} elseif ($query->num_rows) {
$status = true;
} else {
$status = false;
}

if($this->currency->getCode() == 'INR') {
$status = false;
}

$method_data = array();

Fatal error: Call to undefined method Cart\Currency::getCode() in /home/sanajewe/public_html/vqmod/vqcache/vq2-catalog_model_payment_pp_express.php on line 76

Re: Hide Paypal Express if currency INR?

Posted: Mon Aug 06, 2018 11:14 pm
by straightlight
Replace:

Code: Select all

if($this->currency->getCode() == 'INR') {
with:

Code: Select all

if (strtoupper($this->config->get('config_currency')) == 'INR') {

Re: Hide Paypal Express if currency INR?

Posted: Thu Aug 09, 2018 8:50 pm
by tahirshoukat
Thanks buddy it's worked perfectly! but now i have installed this Extension https://www.opencart.com/index.php?rout ... load_id=56 and it's shows again.

I know this is because of XML file i uploaded for "PayPal payment Standard & Express in local currency" can you pls guide me where i have to change the code in my xml file.

The file is Attached below:

Re: Hide Paypal Express if currency INR?

Posted: Fri Aug 10, 2018 4:53 am
by straightlight
Contact the extension developer to resolved this issue.