Croonical Posted July 16, 2013 Share Posted July 16, 2013 (edited) Hello everybody ! I've developed a payment module, but i can't find it in the "Modules list" when i use the Payment tab (in modules). However i find it when i use the other ways (Modules/Module/Payment for example). public function __construct() { //[...] $this->tab = 'payments_gateways'; //[...] } I set the tab value to 'payments_gateways', i thought it was enough, but maybe i'm missing something ? Thanks ! Edited July 16, 2013 by Croonical (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted July 16, 2013 Share Posted July 16, 2013 Hi, please check this code, solution inside: foreach ($modules as $module) if ($module->tab == 'payments_gateways') { if ($module->id) { if (!get_class($module) == 'SimpleXMLElement') $module->country = array(); $countries = DB::getInstance()->executeS(' SELECT id_country FROM '._DB_PREFIX_.'module_country WHERE id_module = '.(int)$module->id.' AND `id_shop`='.(int)$shop_id ); foreach ($countries as $country) $module->country[] = $country['id_country']; if (!get_class($module) == 'SimpleXMLElement') $module->currency = array(); $currencies = DB::getInstance()->executeS(' SELECT id_currency FROM '._DB_PREFIX_.'module_currency WHERE id_module = '.(int)$module->id.' AND `id_shop`='.(int)$shop_id ); foreach ($currencies as $currency) $module->currency[] = $currency['id_currency']; if (!get_class($module) == 'SimpleXMLElement') $module->group = array(); $groups = DB::getInstance()->executeS(' SELECT id_group FROM '._DB_PREFIX_.'module_group WHERE id_module = '.(int)$module->id.' AND `id_shop`='.(int)$shop_id ); foreach ($groups as $group) $module->group[] = $group['id_group']; } else { $module->country = null; $module->currency = null; $module->group = null; } $this->payment_modules[] = $module; } Regards Link to comment Share on other sites More sharing options...
Croonical Posted July 18, 2013 Author Share Posted July 18, 2013 Hi, Thanks for your answer. I took a look at your code (from AdminPaymentController) but i still can't see the solution. I did a var_dump on my module and another one (moneybookers, which is displayed in the list) in order to compare, but i have the same output. Any idea ? Link to comment Share on other sites More sharing options...
Croonical Posted July 19, 2013 Author Share Posted July 19, 2013 Anyone ? Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted July 22, 2013 Share Posted July 22, 2013 Try to debag this controller and find place of code, of whom skips this line: $this->payment_modules Link to comment Share on other sites More sharing options...
Croonical Posted July 22, 2013 Author Share Posted July 22, 2013 (edited) Thank you again Alexander for your answer. Actually i just checked, the line $this->payment_modules[] = $module; isn't skipped with my module. It seems that my module is added to the array. I also added var_dump($this->payment_modules); after the loop, and my module correctly appears, among the other ones. I really don't see the problem here.. Edited July 22, 2013 by Croonical (see edit history) Link to comment Share on other sites More sharing options...
Alex Simonchik BelVG Posted July 23, 2013 Share Posted July 23, 2013 (edited) Hi again, inside AdminPaymentController payment_modules array founds 9 times, for example function renderView() assign smarty variables for tpl: admin/themes/default/template/controllers/payment/restrictions.tpl Regards Edited July 23, 2013 by Alexander Simonchik (see edit history) 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