Jump to content

Implementing pdf file attachment in category


jafakash cp

Recommended Posts

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

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 by Scully (see edit history)
  • Like 1
Link to comment
Share on other sites

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

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 by jafakash cp (see edit history)
Link to comment
Share on other sites

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 this


Thanks

 

Jafakash

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...