MisterM74 Posted September 3, 2010 Share Posted September 3, 2010 BonjourJe voudrais ajouter une extension comme par exemple , .pdf dans le fichier image.inc.php pour ajouter des fichiers pdf lors de l'envoie d'image dans la section personnalisation ...Merci de votre aide , car , j'ai aucune notion de programmation sur le sujet , est encore une fois , une aide , serait la bienvenue ...Bonne journéeMM Link to comment Share on other sites More sharing options...
jeckyl Posted September 3, 2010 Share Posted September 3, 2010 Bonjour,avez vous fait une recherche sur le forum car il me semble que ceci a déjà était traité ? Link to comment Share on other sites More sharing options...
Patric Posted September 3, 2010 Share Posted September 3, 2010 Topic déplacé. Link to comment Share on other sites More sharing options...
MisterM74 Posted September 4, 2010 Author Share Posted September 4, 2010 BonjourIl y à possibilité que vous donnez un coup de main , car je ne trouve pas dans le forum , ou soit , je suis à côté de la porte ....Merci Bonne journéeMM Link to comment Share on other sites More sharing options...
jeckyl Posted September 4, 2010 Share Posted September 4, 2010 http://www.prestashop.com/forums/viewthread/49093/je suis passé par google et j'ai juste marqué :"envoyer des fichier pdf avec la personnalisation de Prestashop". Link to comment Share on other sites More sharing options...
MisterM74 Posted September 5, 2010 Author Share Posted September 5, 2010 Bonjour est merci de cette réponse, mais le lien du topics que vous m'avez envoyer , c'est la modification du fichier product.php est displayImage.php est non pas le fichier image.inc.php , surement que je me trompe , car j'ai déjà modifier ces fichiers , est le fichier product.php , ce plante , il reste blanc , savez-vous ou je dois ajouter ces lignes dans ces fichiers ?Fichier product.php pour l'extension zip function isZIP($file) { /* Detect mime content type */ $mime_type = false; $types = array('multipart/x-zip','application/zip','application/x-zip-compressed','application/x-zip'); if (function_exists('finfo_open')) { $finfo = finfo_open(FILEINFO_MIME); $mime_type = finfo_file($finfo, $file['tmp_name']); finfo_close($finfo); } elseif (function_exists('mime_content_type')) $mime_type = mime_content_type($file['tmp_name']); elseif (function_exists('exec')) $mime_type = trim(exec('file -b --mime-type '.escapeshellarg($file['tmp_name']))); if (empty($mime_type) || $mime_type == 'regular file') $mime_type = $file['type']; if (($pos = strpos($mime_type, ';')) !== false) $mime_type = substr($mime_type, 0, $pos); // is it a picture ? return $mime_type && in_array($mime_type, $types); } function pictureUpload(Product $product, Cart $cart) { global $errors; if (!$fieldIds = $product->getCustomizationFieldIds()) return false; $authorizedFileFields = array(); foreach ($fieldIds AS $fieldId) if ($fieldId['type'] == _CUSTOMIZE_FILE_) $authorizedFileFields[intval($fieldId['id_customization_field'])] = 'file'.intval($fieldId['id_customization_field']); $indexes = array_flip($authorizedFileFields); foreach ($_FILES AS $fieldName => $file) if (in_array($fieldName, $authorizedFileFields) AND isset($file['tmp_name']) AND !empty($file['tmp_name'])) { $fileName = md5(uniqid(rand(), true)); if (($error = checkImage($file, intval(Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE')))) && (!isZIP($file))) { $errors[] = $error; return false; } if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($file['tmp_name'], $tmpName)) { return false; } if (isZIP($file)) { $fileName = "P" . $fileName; if (!copy($tmpName, _PS_PROD_PIC_DIR_.$fileName)) { $errors[] = Tools::displayError('An error occurred during the file upload.'); return false; } $oldfile = './img/zip.jpg'; } else { $fileName = "J" . $fileName; if (!imageResize($tmpName, _PS_PROD_PIC_DIR_.$fileName)) { $errors[] = Tools::displayError('An error occurred during the image upload.'); return false; } $oldfile = $tmpName; } if (!imageResize($oldfile, _PS_PROD_PIC_DIR_.$fileName.'_small', intval(Configuration::get('PS_PRODUCT_PICTURE_WIDTH')), intval(Configuration::get('PS_PRODUCT_PICTURE_HEIGHT')))) { $errors[] = Tools::displayError('An error occurred during the image upload.'); return false; } if (!chmod(_PS_PROD_PIC_DIR_.$fileName, 0777) OR !chmod(_PS_PROD_PIC_DIR_.$fileName.'_small', 0777)) { $errors[] = Tools::displayError('An error occurred during the image upload.'); return false; } $cart->addPictureToProduct(intval($product->id), $indexes[$fieldName], $fileName); unlink($tmpName); } return true; } Est autre ....Avec cette option d'importation , on peut le faire pour autre extension , par exemple , fichier Illustrator est CorelDraw ?Merci de votre aide Michel Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now