Jump to content

How to use PrestaShop 1.7 core functions on php file?


bombis

Recommended Posts

Hello!

I'm doing custom PHP that needs to use Prestashop base functions.

In 1.6 i used to do:

   include '../config/settings.inc.php';
   include '../config/defines.inc.php';
   include '../config/config.inc.php'; 
   include '../init.php'; 

And i was able to use, for example, the function Mail::Send and other core classes and objects.

Any ideas how to do this in Prestashop 1.7?

Thanks!

Link to comment
Share on other sites

Nothing has changed.
Only one include_once is needed.

When the php file will be in the main directory of Prestashop:

include_once('../config/config.inc.php');

When the php file will be in modules/my_module/, for example:

include_once('../../../config/config.inc.php');

obrazek.png.c5f3178e869d81ad5dcd89e42dc8df4f.png

etc.

Edited by Guest (see edit history)
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...