Jump to content

Adding file upload to ProductComment module.


Recommended Posts

I am trying to allow users to upload an image of the product at the same time they post a comment on it via the module ProductComment.

 

My modifications are heavily inspired by this post => https://www.prestashop.com/forums/topic/402368-how-to-add-an-input-file-uploader-in-customer-registration-form-v16/?do=findComment&comment=1981006

 

The thing is, I am stuck because I can't seem to access $_FILES datas from the controller (default.php) and I realy don't see why. My setup works if I do a simple <input> but when it's the type="file" I just can't and it is driving me crazy.

 

If you have any kind of clue, please help :D

Link to comment
Share on other sites

the ProductComment module using ajax to post data. You can refer themes\*\js\modules\productcomments\js\productcomments.js and file modules\productcomments\js\productcomments.js, find "action=add_comment". You need update the ajax function for post input with type is file.

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