nick03 Posted September 4, 2013 Share Posted September 4, 2013 I created a new module basing on the "cheque" module . In the modules page (AdminModules) is shown. But in the payments page (AdminPayment), in the upper part is not shown together with all other modules. Why? What I forgot to put in the code? Link to comment Share on other sites More sharing options...
vekia Posted September 4, 2013 Share Posted September 4, 2013 your module has got $this->registerHook('payment') ? and have you got there: $this->tab = 'payments_gateways'; ? Link to comment Share on other sites More sharing options...
nick03 Posted September 4, 2013 Author Share Posted September 4, 2013 yes, in function __construct() i have $this->tab = 'payments_gateways'; and in function install() i have if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) return false; return true; Link to comment Share on other sites More sharing options...
vekia Posted September 4, 2013 Share Posted September 4, 2013 that's weird. You also changed name of the module? (you said that you copied cheque module) Link to comment Share on other sites More sharing options...
nick03 Posted September 4, 2013 Author Share Posted September 4, 2013 (edited) yes i have chenged $this->name and also the name in config.xml there are no strings with cheque nowhere I have changed all Edited September 4, 2013 by nick03 (see edit history) Link to comment Share on other sites More sharing options...
nick03 Posted September 5, 2013 Author Share Posted September 5, 2013 any suggestions? Link to comment Share on other sites More sharing options...
bellini13 Posted September 5, 2013 Share Posted September 5, 2013 you have the currency, group and country restrictions setup properly in your back office? Link to comment Share on other sites More sharing options...
nick03 Posted September 8, 2013 Author Share Posted September 8, 2013 Can you explain better what should I check? Link to comment Share on other sites More sharing options...
bellini13 Posted September 8, 2013 Share Posted September 8, 2013 Go to the back office, modules | payment section, and review your currency, group and country restrictions Link to comment Share on other sites More sharing options...
nick03 Posted September 8, 2013 Author Share Posted September 8, 2013 yes all restrictions are setup correctly Link to comment Share on other sites More sharing options...
bellini13 Posted September 8, 2013 Share Posted September 8, 2013 (edited) if you want to post the entire module, we can review it. otherwise its anyones guess Edited September 8, 2013 by bellini13 (see edit history) Link to comment Share on other sites More sharing options...
nsdan2k Posted September 9, 2013 Share Posted September 9, 2013 I have the exact same problem. my payment module won't show up in admin menu/modules/payment (http://localhost/prestashop/admin4162/index.php?controller=AdminPayment). my module is also based on the cheque module.http://pisoads.com.ph/globeloadv1c.rar . Also another bug is when my payment module payment_execution.tpl is shown, the form's width is too narrow and the right column blocks are squished in with my form same code : in function __construct() i have $this->tab = 'payments_gateways'; and in function install() i have if (!parent::install() OR !$this->registerHook('payment') OR !$this->registerHook('paymentReturn')) return false; return true; Link to comment Share on other sites More sharing options...
nsdan2k Posted September 9, 2013 Share Posted September 9, 2013 (edited) After checking furthur it seems i am still able to set restrictions for my custom payment module, it only doesnt show up on my payment module list. so this must be a minor bug. A hack to this is to edit my AdminPaymentController.php renderView function and add the line array_push($this->filter_modules_list,"mypaymentmodulename"); $this->tpl_view_vars = array( 'modules_list' => $this->renderModulesList(), 'display_restrictions' => $display_restrictions, .... However my more urgent problem is payment_execution.tpl is shown, the form's width is too narrow and the right column blocks are squished in with my form Edited September 9, 2013 by nsdan2k (see edit history) Link to comment Share on other sites More sharing options...
Kazeno Posted September 14, 2013 Share Posted September 14, 2013 Hi, turns out this is not a bug, but a "feature": the only modules that appear at the top of the Payment tab are the ones sanctioned by Prestashop, i.e. made by themselves or by their "Certified Partners". The modules list is retrieved from http://api.prestashop.com/xml/tab_modules_list.xml and is cached in config/xml/tab_modules_list.xml in your store directory. You could temporarily add your module to this file, but it's gonna be erased next time the system refreshes (redownloads) it. You could try adding a custom hook to run after AdminController->refresh() so that it re-adds your module to the file after each refresh, but I don't think the Prestashop Addons team would accept such a hack if you want to sell your module in their store. 2 Link to comment Share on other sites More sharing options...
selmen2004 Posted September 28, 2013 Share Posted September 28, 2013 @Kazeno , searched some time and found the same thing , thanks for your reply Link to comment Share on other sites More sharing options...
ARubenC Posted January 20, 2014 Share Posted January 20, 2014 (edited) Hello, Perhaps it's too late, but it can help someone else. The solution to see your own modules in the Payment page, it's to override the AdminController class. Ex: for v1.5.6.0, in the function getModulesList, in line 2302, add this code: //Modif start: for AdminPayment module, add our module to the Prestashop'filter_modules_list to display them if ($this->controller_name == 'AdminPayment') { $my_payment_modules = $this->payment_modules; if (!is_array($this->payment_modules) && !is_null($this->payment_modules)) $my_payment_modules = array($this->payment_modules); if (count($my_payment_modules)) { foreach ($my_payment_modules as $my_module) { if (!in_array($my_module->name, $filter_modules_list)) $filter_modules_list[] = $my_module->name; } } } //Modif end Don't forget to delete the "class_index.php" file in the "cache" folder if you don't yet override this class. Well, enjoy! Edited January 25, 2014 by rubena (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now