简体   繁体   English

opencart 2.3 install()方法不起作用

[英]opencart 2.3 install() method not working

I have a payment plugin which is working fine on opencart 2.0 , I tried to install it on opencart 2.3 everything works fine but there is piece of code written in the install() method .. but its not working on opencart 2.3. 我有一个付款插件,可以在opencart 2.0上正常工作,我试图将其安装在opencart 2.3上,但一切正常,但是在install()方法中编写了一段代码..但在opencart 2.3上却无法正常工作。

I tried to dump in it, but nothing happen, it seems opencart2.3 is not calling my install() method at all. 我试图将其转储,但没有任何反应,似乎opencart2.3根本没有调用install()方法。

Additional Information : The plugin name is Payfort and its on github https://github.com/payfort/opencart2.0-payfort The plugin is working on both versions 2.0 & 2.3 附加信息:插件名称为Payfort,其名称为github https://github.com/payfort/opencart2.0-payfort插件可同时用于2.0和2.3版本

Opencart 2.3 folder structure is different from 2.0 for example your payment folders are catalog/controller/extension/payment in 2.3 and in 2.0 it is catalog/controller/payment. Opencart 2.3文件夹的结构与2.0不同,例如,您的付款文件夹在2.3中是目录/控制器/扩展名/付款,而在2.0中是目录/控制器/付款。 The "extension" is added on later versions. 在以后的版本中添加了“扩展名”。 $this->load->language('extension/payment/????') will also be different as the folder structure changed. $ this-> load-> language('extension / payment / ????')也会随着文件夹结构的更改而有所不同。 So it most probably not calling the correct public function. 因此,它很可能没有调用正确的公共函数。 Contact the author of the plugin to change/update the plugin. 与插件作者联系以更改/更新插件。 If it the payment is directed to a Payment Gateway for instance paypal or payfast. 如果是,则将付款定向到付款网关,例如贝宝或payfast。 If you have written the plugin your self. 如果您自己编写插件, You can use the PP_Standard module to duplicate and rewrite a custom plugin. 您可以使用PP_Standard模块复制并重写自定义插件。 https://forum.opencart.com/viewtopic.php?f=136&t=30653 https://forum.opencart.com/viewtopic.php?f=136&t=30653

Hopes this helps. 希望这会有所帮助。

In OpenCart 2.3.0.2 the install method of class ControllerExtensionExtensionPayment (placed in: admin/controller/extension/extension/payment.php) is called when a payment extension is installed. 在OpenCart 2.3.0.2中,安装付款扩展后,将调用类ControllerExtensionExtensionPayment的安装方法(位于:admin / controller / extension / extension / payment.php中)。

In this method the install method of the payment's controller is called: 在此方法中,付款控制器的安装方法称为:

// Call install method if it exsits
$this->load->controller('extension/payment/' . $this->request->get['extension'] . '/install');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM