Post by wallythg » Fri Jun 17, 2016 12:14 am

Hi guys, I've been trying to install a plugin called Openpay (http://www.openpay.mx/en/docs/plugins/opencart.html), when I go to extension installer everything seems ok, but when I go to the Payments and try to add it, I always get this error

Fatal error: Call to undefined method Cart\Currency::getCode() in C:\xampp\htdocs\shopTest\system\library\openpaycardscontroller.php on line 18

The line in question from that file is this:
$minTotal = $this->currency->convert(1, 'USD', $this->currency->getCode());

I checked the folders after the installations, and in the language folers I've always had "en-gb" , but this extension created a folder called "english" then "payment" and then an extension file. I've tried moving this file to the en-gb/payment route, but I still get the same error.

Weird thing, I tried installing a couple other extensions such as Most Viewed, but I get similar errors, always something about currency.

Does it have anything to do with the Opencart version?? I've tried contacting the Openpay administrators, but no response.
Do ou guys have any tips on how to solve this? Thank you!!

Newbie

Posts

Joined
Thu Jun 16, 2016 11:40 pm

Post by Johnathan » Fri Jun 17, 2016 12:26 am

In OpenCart 2.2 the getCode() function was removed. You should be able to fix it with this replacement:

Code: Select all

REPLACE:
$this->currency->getCode()

WITH:
$this->config->get('config_currency') 

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by wallythg » Fri Jun 17, 2016 2:12 am

Johnathan wrote:In OpenCart 2.2 the getCode() function was removed. You should be able to fix it with this replacement:

Code: Select all

REPLACE:
$this->currency->getCode()

WITH:
$this->config->get('config_currency')
Perfect, this worked!

However, after I try to edit the Extension, I get all sorts of errors.

"Warning: Missing argument 2 for Cart\Currency::format(), called in C:\xampp\htdocs\orbileTest\admin\controller\payment\openpay_cards.php on line 81 and defined in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 24Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 25Notice: Undefined index: in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 25Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 26Notice: Undefined index: in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 26Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 27Notice: Undefined index: in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 27Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 30Notice: Undefined index: in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 30Warning: Missing argument 1 for Cart\Currency::getSymbolLeft(), called in C:\xampp\htdocs\orbileTest\admin\controller\payment\openpay_cards.php on line 126 and defined in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 80Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 81Warning: Missing argument 1 for Cart\Currency::getSymbolRight(), called in C:\xampp\htdocs\orbileTest\admin\controller\payment\openpay_cards.php on line 127 and defined in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 88Notice: Undefined variable: currency in C:\xampp\htdocs\orbileTest\system\library\cart\currency.php on line 89"

I'm guessing this is all because I'm using 2.2 and the plugin is out of date. What would you recommend me?? This seems like a lot of trouble

Newbie

Posts

Joined
Thu Jun 16, 2016 11:40 pm

Post by straightlight » Tue Jun 21, 2016 2:41 am

I'm guessing this is all because I'm using 2.2 and the plugin is out of date. What would you recommend me?? This seems like a lot of trouble
Contact the developer of the extension you are using. They should be able to resolved this.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Johnathan » Wed Jun 22, 2016 5:46 am

Yes, if you're getting those errors the extension hasn't been updated for OpenCart 2.2. You'll need to do what straightlight suggests, and contact the developer to get the extension updated for you.

If they're unwilling or unavailable to help, you'll probably need to hire someone to fix it for you. If you need to find a developer, I recommend you post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by wallythg » Fri Jul 08, 2016 3:09 am

Awesome!! Thank you so much! I'll try that!

Newbie

Posts

Joined
Thu Jun 16, 2016 11:40 pm
Who is online

Users browsing this forum: No registered users and 6 guests