Jump to content

access prestashop features from outside the backoffice


Recommended Posts

Hi everybody. I'm working in a project of hosting multiple instances of prestashop and integrate them with an ERP of our own. we've developed a prestashop module to make the integration possible. The thing is that, when we want to upgrade our prestashop module we "emulate" the manual process. That is to say, we do something like this:

1) from outside php application we cURL ajax-tab.php and POST controller=AdminLogin&submitLogin=1&passwd=*****&email=ADMIN@EMAIL&redirect=AdminModules 

2) We obtain the admin token from the response headers

3) then we cURL index.php and POST controller=AdminModules&uninstall=OURMODULE&tab_module=others&module_name=OURMODULENAME&anchor=OURMODULENAME&token=OBTAINEDTOKEN

4) after prestashop do its job we delete the old module, copy the new files and cURL the new installation like this,  index.php and POST controller=AdminModules&install=OURMODULE&tab_module=others&module_name=OURMODULENAME&anchor=OURMODULENAME&token=OBTAINEDTOKEN

Issues:

* Although the process is working, I'm not very happy with it. I was reserching, but I didn't find anything to guide me in the way of correctly use the prestashop Tools.php from outside backoffice and use the getAdminToken method.

* We couldn't make "delete=OURMODULE" work, so we have to uninstall->delete->install 

* Besides, we have to "sleep(5)" between uninstall and install, if not we've received a prestashop error as if the module was already installed...

* At the very beginning we worked directly to database, but now I'm trying to replace this way in order to enable future upgrades to be easier to perform.

If  anyone could give me a hand in where to start I'll be eternally grateful!!
 

Thanks in advance and excuse my english!!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...