Jump to content

Edit History

Eolia

Eolia

Il faut modifier le code du module pour le mettre en pièce-jointe lors de l'envoi du mail.

Code à insérer avant

if ($dir_mail)
                Mail::Send(

            if ($order->invoice_number || $order->delivery_number) {

                $file_attachement = array();

                if ((int)Configuration::get('PS_INVOICE') && $order->invoice_number) {
                    $order_invoice_list = $order->getInvoicesCollection();
                    Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
                    $pdf = new PDF($invoice, PDF::TEMPLATE_INVOICE, $this->context->smarty);
                    $file_attachement['invoice']['content'] = $pdf->render(false);
                    $file_attachement['invoice']['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf';
                    $file_attachement['invoice']['mime'] = 'application/pdf';
                }
                if ($order->delivery_number) {
                    $pdf = new PDF($invoice, PDF::TEMPLATE_DELIVERY_SLIP, $this->context->smarty);
                    $file_attachement['delivery']['content'] = $pdf->render(false);
                    $file_attachement['delivery']['name'] = Configuration::get('PS_DELIVERY_PREFIX', $this->context->language->id, null, $order->id_shop).sprintf('%06d', $order->delivery_number).'.pdf';
                    $file_attachement['delivery']['mime'] = 'application/pdf';
                }
            } 
            else {
                $file_attachement = null;
            }

 

Eolia

Eolia

Il faut modifier le code du module pour le mettre en pièce-jointe lors de l'envoi du mail.

Code à insérer avant Mail::Send(

            if ($order->invoice_number || $order->delivery_number) {

                $file_attachement = array();

                if ((int)Configuration::get('PS_INVOICE') && $order->invoice_number) {
                    $order_invoice_list = $order->getInvoicesCollection();
                    Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list));
                    $pdf = new PDF($invoice, PDF::TEMPLATE_INVOICE, $this->context->smarty);
                    $file_attachement['invoice']['content'] = $pdf->render(false);
                    $file_attachement['invoice']['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf';
                    $file_attachement['invoice']['mime'] = 'application/pdf';
                }
                if ($order->delivery_number) {
                    $pdf = new PDF($invoice, PDF::TEMPLATE_DELIVERY_SLIP, $this->context->smarty);
                    $file_attachement['delivery']['content'] = $pdf->render(false);
                    $file_attachement['delivery']['name'] = Configuration::get('PS_DELIVERY_PREFIX', $this->context->language->id, null, $order->id_shop).sprintf('%06d', $order->delivery_number).'.pdf';
                    $file_attachement['delivery']['mime'] = 'application/pdf';
                }
            } 
            else {
                $file_attachement = null;
            }

 

×
×
  • Create New...