gheaeckkseqrz Posted April 20, 2013 Share Posted April 20, 2013 Hello, I'm developing a clothing e-shop. I'm making a module to filter product by color / size / categories ... I'd like to have it working via Ajax. I need t load smarty & the database classe in my Ajax target .php file. How can I do that ? Regards, Pierre. Link to comment Share on other sites More sharing options...
Paul C Posted April 20, 2013 Share Posted April 20, 2013 (edited) You can just include the following at the start of your file: <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../init.php'); include(dirname(__FILE__).'/yourmodule.php'); $module = new YourModule(); echo $module->yourAjaxHandler(); That will load up all the Prestashop goodness in your script, and also then allow you to place the actual ajax call function within your module (from where you can access the facilities you need). You can also use Tools:getValue('post_or_get_variable') if you need to pass parameters. This is exactly how the blocklayered module works btw and that would be a good source of "inspiration" Edited April 20, 2013 by Paul C (see edit history) Link to comment Share on other sites More sharing options...
gheaeckkseqrz Posted April 22, 2013 Author Share Posted April 22, 2013 Thanks, It works like a charm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now