How can I make, that users can add picture (upload from their computer) in order form and their picture will be than send to adminstration or on email?
uploading picture and not displaying it on order form page should be no problem (I think). But sending it via email.. might not be easy. It's technically possible, though, some reprogramming is perhaps needed.
This is only an example. To any existing template add a Form: <form action="" method="post" id="kontaktl" enctype="multipart/form-data" onsubmit="this.tarcze_laden.value='Please wait...';"> <table> <tr> <td class="sendfile" >File on local PC: <input type="file" name="datei" class="inputf"></td> <td class="sendfile" input type="submit" value="Upload file" class="submit" name="upload"></td> </tr> </table> </form>
Then add a few lines code to (for example /templates/themes/default.php) if ( isset ( $_POST['upload'] ) ) { $dateityp = GetImageSize($_FILES['datei']['tmp_name']); $folder = "myfolderforupload/"; $sHome = "myEmail@domain.de"; $header = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/plain; charset=UTF-8'. "\n" . 'From: <' . $sHome . ">\n"; $sBetreff = "A file has been uploaded"; if ( $dateityp[2] != 0 ){ if($_FILES['datei']['size'] < 1048576) { move_uploaded_file($_FILES['datei']['tmp_name'], $ordner.$_FILES['datei']['name']); $sTekst = $_FILES['datei']['name']; @mail($sHome, $sBetreff, $sTekst, $header); $content .= $oTpl->tbHtml( 'messages.tpl', 'SENDFILE_OK' ).$_FILES['datei']['name']; } else { $content .= $oTpl->tbHtml( 'messages.tpl', 'NOT_SENDFILE_BYTE' ); } } else { $content .= $oTpl->tbHtml( 'messages.tpl', 'NOT_SENDFILE_TYPE' ); }
}
If you want, that the uploading user should get a message on the site, than create new blocks in message.tpl and give them the example names (SENDFILE_OK, NOT_SENDFILE_BYTE, NOT_SENDFILE_TYPE)
In the line: if($_FILES['datei']['size'] < 1048576) { you can determine the maximum size of file (in bytes). The example above is set to 1MB. in this line: if ( $dateityp[2] != 0 ){ you can determine the type of file (pictures, or others)
More details you will find here: http://php.net/manual/en/features.file-upload.php
Important: the form must have a property: enctype="multipart/form-data" and you have to create a folder on your server (in this example: "myfolderforupload"). And in this solution you will get the email message, that a file has been uploaded (with the name of file), you will NOT get the file as an attachment. You have to take it manually from the folder.
Damn, I just realized what Wizz is up to... I was tired before and didn't understand it in the right way. Must think about it more, will write here if something occurs to me.