Jump to content

how can Configuration::get(''); work on my custom .php file


aljon ngo

Recommended Posts

Hello i created a module, for example my module name is product inquiry.

 

how can the codes below work on my other php files that is not a class.

echo Tools::getValue('id_product');
echo Configuration::get('module_NAME');

currently i have 2 files in my root module file

 

productinquiry.php - this is where i set    class productinquiry extends Module

process.php - this is where my form will be send inside my modules folder , this is also where i wanted to use tools: and configuration: but it is not working

Edited by aljon ngo (see edit history)
Link to comment
Share on other sites

Add the following lines to the top of your process.php file.  This will cause the core Prestashop files to autoload and make them available to you.  It will also load your module class so you can utilize any module functions you require

 

include(dirname(__FILE__). '/../../config/config.inc.php');
include(dirname(__FILE__). '/../../init.php');
include(dirname(__FILE__). '/productinquiry.php');
 

Link to comment
Share on other sites

Add the following lines to the top of your process.php file.  This will cause the core Prestashop files to autoload and make them available to you.  It will also load your module class so you can utilize any module functions you require

 

include(dirname(__FILE__). '/../../config/config.inc.php');

include(dirname(__FILE__). '/../../init.php');

include(dirname(__FILE__). '/productinquiry.php');

 

 

it works but if i add it to my codes .. my jquery post form doesnt work. in the process.php.

Edited by aljon ngo (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...