Jump to content

Another Upload-Files and bigger text fields


Recommended Posts

Hi,

sorry for my bad english, but i have 2 questions.

For my shop i need the opportunity for my customers to upload files. When i activate the possibility in the admin area, i have only the choice between png and jpeg-files.
But my customers have to upload .zip files and/or word-documents.

My second problem ist the textfield at the products.
there ist only one line for the customers to leave a message for me, when they put a item into the cart.
I need a textarea for 500 or more letters.

Is there a possibility to make this changes with prestashop?

Link to comment
Share on other sites

themes >>>> your theme >>> order-address.tpl & order-detail. tpl

order-address.tpl Line 75
from:

<textarea cols="60" rows="3" name="message">{$oldMessage}</textarea></p>


to: rows 30 or may be less 10 depends on what you expect to get a note or a testament

order-detail. tpl line 266
From:


       <textarea cols="67" rows="3" name="msgText"></textarea>


to: rows="30" or may be less 10 depends on what you expect to get a note or a testament

 



about your upload file type try this i dont know if it works but is the only thing i found so far

 



Go to main directory look for images.inc.php edit line 48 to 63

/**
 * Check image upload
 *
 * @param array $file Upload $_FILE value
 * @param integer $maxFileSize Maximum upload size
 */
function    checkImage($file, $maxFileSize)
{
   if ($file['size'] > $maxFileSize)
       return Tools::displayError('image is too large').' ('.($file['size'] / 1000).Tools::displayError('KB').'). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 1000).Tools::displayError('KB');
   if (!isPicture($file))
       return Tools::displayError('image format not recognized, allowed formats are: .gif, .jpg, .png');
   if ($file['error'])
       return Tools::displayError('error while uploading image; change your server\'s settings').'('.Tools::displayError('Error code: ').$file['error'].')';
   return false;
}


to this will change the file size and include other file extentions

return Tools::displayError('image is too large').' ('.($file['size'] / 10000).Tools::displayError('KB').'). '.Tools::displayError('Maximum allowed:').' '.($maxFileSize / 10000).Tools::displayError('KB');
   if (!isPicture($file))
       return Tools::displayError('image format not recognized, allowed formats are: . tiff, .gif, .jpg, .png, .zip, .rar,');


file size fron 1000 kb 1mg more or less 1024kb=1mg so 1000 change to 10000 new upload size = close to 10mg ad a 0 100mg another 0 1000mg or close to 1gb, bla bla bla


allowed formats are: . tiff, .gif, .jpg, .png, .zip, .rar,') just add what ever extension you want to allow for upload

good luck, hope it works

Link to comment
Share on other sites

Thanks for the answers.

@tomerg3: thank you, but this module is too much for my requirement.

@RJGonzales:

hank our for the ideas.

Your tipp for the upload file doesnt work, cause you changes only the message, when the customer upload a wrong file.


Your tipp for the textarea works, but i think you missunderstood me. I dont want to change the textarea at the orderstatus, i mean the textarea at the product-details.

Look at the attachment!

37370_DUyf7wpRF0RXbRP35VfL_t

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