Jump to content

Product Customization file upload PDF


Mikeeee

Recommended Posts

Hey,

I have a field on my product page to let users upload a file. I'm going to sell LED Panels and I am offering the service to print custom images on it. It works as intended, however users are only allowed to upload .jpg, .png and .gif. As I'm going to be printing these images I would also like for the option to be able to let them upload a pdf file with the image into it. 

I found a little bit of code regarding the uploader and added the .pdf extension to it as seen below, however this still blocks it from allowing PDF uploads.

 image.png.e7784d968d7d7f653bef3abfc1789f2c.png

I suspect that there are their more checks in place to prevent pdf upload or that it might cancel because it tries to convert the pdf to an image and fails? It doesn't display an error on my page even though debug mode is on (maybe because of my theme). 

I found this in the same file and I suspect it doesn't work because PDF is not being converted to an image and therefore cannot convert?

image.png.0794e7a54b608cbf3976619da95a4d79.png

 

I know that there are modules out there to allow for different file uploads but I think that such a small thing as allowing an extra extension shouldn't be paid for.

Does anyone know how to do it? I am using prestashop 1.7.4.2

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

  • 2 months later...
  • 9 months later...

Hi!

I have the same problem. Have you found a solution? I could have let the pdf file upload but from the back I can't see it. It's true that it's saved in the uploads folder but the logistics team doesn't have access by ftp, so I need it to be visualized in the order page.

Link to comment
Share on other sites

  • 3 months later...
  • 10 months later...

Looks like trivial modfication...

1. modify pictureUpload function in ProductController.php
2. modify 1 backoffice twig file to display the link with name of uploaded file like test.pdf -> because there will be no thumbnail from such a pdf file so Prestashop will not display it in order product details.

I will write a complete tutorial in my free time.

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

  • 3 months later...

@harry84


Right now their is not simple module unpaid without that it can be done. It will better if PrestaSop team allowed some kind of filter array like WordPress which allowed user to filter any value for their need. If can told us details we will short list our future free module list.

 

We are trying to made PrestaShop user life easier.

 

Thank you

Link to comment
Share on other sites

  • 10 months later...

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