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!!
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!!
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!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')
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
Contact the developer of the extension you are using. They should be able to resolved this.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
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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.
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.
Who is online
Users browsing this forum: No registered users and 6 guests