=') && version_compare(_PS_VERSION_, 1.5, '<')) { return parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop, $bcc); } $files_attachments = array(); //Prendre le formulaire de rétractation s'il existe if (Configuration::get('MD_CGV_INVOICE_WITHDRAWAL') == 1 && Configuration::get('MD_CGV_WITHDRAWALFORM')) { $form = array('content' => Tools::file_get_contents(_PS_ROOT_DIR_.'/modules/mdtossend/form/'.Configuration::get('MD_CGV_WITHDRAWALFORM')), 'name' => 'withdrawal_form.pdf', 'mime' => 'application/pdf'); $files_attachments[] = $form; } //Ajouter les CGV en PJ si elles sont pas ajouté à la facture ou du coup, si la version est une 1.4 if ((Configuration::get('MD_CGV_INVOICE') == 0) || (version_compare(_PS_VERSION_, 1.4, '>=') && version_compare(_PS_VERSION_, 1.5, '<'))) { $iso = Language::getIsoById($id_lang); $pdf = ''; if (version_compare(_PS_VERSION_, 1.5, '>')) { if ($id_shop == null) $id_shop = Context::getContext()->shop->id; $pdf = _PS_ROOT_DIR_.'/modules/mdtossend/pdf/cgv_'.$iso.'_'.$id_shop.'.pdf'; } else $pdf = _PS_ROOT_DIR_.'/modules/mdtossend/pdf/cgv_'.$iso.'.pdf'; $cgv = array('content' => Tools::file_get_contents($pdf), 'name' => 'cgv.pdf', 'mime' => 'application/pdf'); $files_attachments[] = $cgv; } //S'il n'y a qu'une seule pièce jointe if ($file_attachment && isset($file_attachment['content'])) { $invoice = array('content' => $file_attachment['content'], 'name' => $file_attachment['name'], 'mime' => $file_attachment['mime']); $files_attachments[] = $invoice; } if (version_compare(_PS_VERSION_, 1.5, '>=')) { return parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $files_attachments, $mode_smtp, $template_path, $die, $id_shop, $bcc); } } else { return parent::Send($id_lang, $template, $subject, $template_vars, $to, $to_name, $from, $from_name, $file_attachment, $mode_smtp, $template_path, $die, $id_shop, $bcc); } } }