jafakash cp Posted July 29, 2017 Share Posted July 29, 2017 Hi team, I have a scenario in a project where i need to add a pdf attachment in prestashop category in admin panel . i need to ovveride admin category controller to show upload file for pdf and uploaded pdf should be stored in image category folder . how to achieve this . please do replay asap . am stuck in my task .Thanks Regards Jafakash Link to comment Share on other sites More sharing options...
Scully Posted July 29, 2017 Share Posted July 29, 2017 (edited) Why not upload the PDF manually and then link them within the short description text in the categories. This should work without any changes in the core. Your approach would require quite some changes in controllers and tpl files. If you are not well experienced, it might get difficult... Edited July 29, 2017 by Scully (see edit history) 1 Link to comment Share on other sites More sharing options...
jafakash cp Posted July 29, 2017 Author Share Posted July 29, 2017 Hi scully, Thanks for the replay . my client requirement will not meet with adding attachment manually and link in short description . I need to add from admin panel as file upload. and am an experianced developer in prestashop i can customise controller or tpl , its not a big deal . i just need a solution only . i hope you can help me. Thanks again for reply Jafakash cp Link to comment Share on other sites More sharing options...
Scully Posted July 29, 2017 Share Posted July 29, 2017 I'm on a mobile device only at the moment. So I cannot give you detailed instructions. But if you are experienced: just ovverride the category controllers, both for admin and front end. Link to comment Share on other sites More sharing options...
jafakash cp Posted July 29, 2017 Author Share Posted July 29, 2017 (edited) hi scully , i got a solution as you said i will create manual attachment and each attachment id is stored in corresponding category using text field by overriding admin controller . now i can use that unique attachment id in each category and can fetch where ever i need.i appreciate your quick response If you have a solution for my previous logic , you can share for future development Thanks Jafakash cp Edited July 29, 2017 by jafakash cp (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted July 29, 2017 Share Posted July 29, 2017 sounds good! Link to comment Share on other sites More sharing options...
jafakash cp Posted August 1, 2017 Author Share Posted August 1, 2017 hi , every thing work fine for me now except one . i have two button one for read pdf another for download pdf . download button working fine by using prestashop attachment link. To read pdf i have commented below code in Attachmentcontroller. header('Content-Disposition: attachment; filename="'.utf8_decode($a->file_name).'"'); but i want both read and download functionality . right now only one function will work either read or download. how to resolve thisThanks Jafakash 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