Jump to content
qwertyu123

Custom Admin Order Module 1.6 to 1.4

Recommended Posts

I created a module in Prestashop 1.6 with the hook being displayAdminOrder and it works perfectly. I am trying to make it backwards compatible with Prestashop 1.4. I have included the toolkit for this, but this is only for inside the function. Since the actual hook name is different the module won't work. In 1.4 the name is adminOrder and the function is hookAdminOrder. In 1.6 the name is displayAdminOrder and the function is hookDisplayAdminOrder. I have tried a simple if statement, but since it is inherently called, this doesn't work. What is the best way to accomplish this?

Share this post


Link to post
Share on other sites

Just select with a if ps_version and place your override depending of the finded version ;)

Share this post


Link to post
Share on other sites

I tried that, it doesn't work:

if (_PS_VERSION_ < '1.5') {
 return parent::install() &&
$this->registerHook('adminOrder')  &&
Configuration::updateValue('myplugin', 'TESTING');
      }
      else
      {
      return parent::install() &&
$this->registerHook('displayAdminOrder')  &&
Configuration::updateValue('myplugin', 'TESTING');
}
then having two seperate functions hookAdminOrder and hookDisplayAdminOrder doesn't work
Edited by qwertyu123 (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More