rachel01 Posted October 1, 2014 Share Posted October 1, 2014 Bonjour, J'aimerais envoyer la facture en pièce jointe lors de l'envoi des mails concernant le statut "Expédié" (et pas Paiement accepté). Comment faire ? Il semble qu'il faille rajouter ce code // Join PDF invoice if ((int)Configuration::get('PS_INVOICE') && $order_status->invoice && $order->invoice_number) { $pdf = new PDF($order->getInvoicesCollection(), PDF::TEMPLATE_INVOICE, $this->context->smarty); $file_attachement['content'] = $pdf->render(false); $file_attachement['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang).sprintf('%06d', $order->invoice_number).'.pdf'; $file_attachement['mime'] = 'application/pdf'; } else $file_attachement = null; Mais la question est dans quel fichier ? Merci d'avance Link to comment Share on other sites More sharing options...
tuk66 Posted October 6, 2014 Share Posted October 6, 2014 Avez-vous essayé de mettre que sous les statuts des commandes? Have you tried to set that under order statuses? Link to comment Share on other sites More sharing options...
rachel01 Posted October 6, 2014 Author Share Posted October 6, 2014 Bonjour, Oui bien sur, mais cela ne fonctionne pas. La facture est bien disponible dans le compte du client, mais elle n'est pas envoyée par mail lors du passage à l'un des statuts cochés. Merci de votre aide Link to comment Share on other sites More sharing options...
tuk66 Posted October 6, 2014 Share Posted October 6, 2014 Peut-être le problème des e-mails? Pouvez-vous envoyer avec succès un email de test? Can be the problem in emails? Can you successfully send a test email? Link to comment Share on other sites More sharing options...
rachel01 Posted October 6, 2014 Author Share Posted October 6, 2014 Oui tout à fait, tout fonctionne. La facture est bien envoyée par mail lors du statut Paiement accepté mais pas Expédié (bien que les 2 soient cochés) Link to comment Share on other sites More sharing options...
rachel01 Posted October 6, 2014 Author Share Posted October 6, 2014 (edited) J'ai trouvé une solution que je poste ici pour ceux qui rencontreraient le même problème. Il suffit de modifier ce code dans OrderHistory.php ligne 411 : // Join PDF invoice if order state is "payment accepted" if ((int)$result['id_order_state'] === 2 && (int)Configuration::get('PS_INVOICE') && $order->invoice_number) par ce code : // Join PDF invoice if order state is "shipped" if ((int)$result['id_order_state'] === 4 && (int)Configuration::get('PS_INVOICE') && $order->invoice_number) Edited October 6, 2014 by hansou (see edit history) Link to comment Share on other sites More sharing options...
prosilver Posted January 21, 2015 Share Posted January 21, 2015 Bjr, génial, merci pour l'info ! 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