piernas Posted March 24, 2015 Posted March 24, 2015 Been inspecting how new hook system works taking it from paypal app. I've come to conclusion the system basically uses these principles: hooks.php in catalog/includes/classes: Class to register and call hook system Calls to create a new instance of the class in catalog/includes/application_top.php and catalog/admin/includes/application_top.php The following changes to orders.php: // this registers the class for this page $OSCOM_Hooks->register('orders'); // this returns the new tab content $OSCOM_Hooks->call('orders', 'orderAction'); // this returns the new tab button $OSCOM_Hooks->call('orders', 'orderTab'); Is this correct? Are there any documentation or sample (apart of paypal app) that covers this hook system? For now I've found that if there are no app classes for this page in includes\hooks\admin\orders the system throws a warning: Warning: Invalid argument supplied for foreach() in C:\htdocs\234_order_editor\includes\classes\hooks.php on line 56 so an error check should be added just in case there are no apps or modules installed, otherwise the system could not be added to other admin pages. Am I right?
piernas Posted March 25, 2015 Author Posted March 25, 2015 Well today I learned about heredoc string method. Nice! :) Also learned how to add a tab and simple content. The script that does the tab button is <script> $(function() { $('#orderTabs ul').append('<li><a href="{$tab_link}">{$tab_title}</a></li>'); }); </script> I'm not good at javascript. Anyone can help me with hiding and reordering the tabs?
katapofatico Posted November 18, 2015 Posted November 18, 2015 related post: Can we get a tutorial on hooks?
piernas Posted November 18, 2015 Author Posted November 18, 2015 I missed that one. Will look, thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.