aaront1 Posted October 9, 2013 Share Posted October 9, 2013 Hi, I want to create a new module tab to upload files under admin->product. so far, I have wrote new_module.php, and it has a function hookDisplayAdminProductsExtra() ->display.tpl to display the upload form and button. and below that form will be shown all the filenames that uploaded before and delete checkbox for each files. in display.tpl I also have the ajax call to post data to function.php. in function.php, I am able to save the upload files in the location I want, and display back the result to display.tpl through the ajax function. but the part I am lost is, how I can connect to the database to store my uploaded URLs infomation? it seems that in function.php I have no way to connect to the PS database. or if not doing the ajax way, how can I achieve this new tab to store the upload files URL to database Link to comment Share on other sites More sharing options...
math_php Posted October 9, 2013 Share Posted October 9, 2013 Hi In the php file wich get and store the upload file, if you put : require('../../config/config.inc.php'); You will have have access to all Prestashop method, function, ressources, etc Best regards Link to comment Share on other sites More sharing options...
vekia Posted October 9, 2013 Share Posted October 9, 2013 it is necessary to include also init.php file, otherwise functions will not work 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