Jump to content

Edit History

Mikael Mortensen

Mikael Mortensen


Solved

Hi,

I use Prestashop 1.6, and generate a Credit slip when customers return products from their ordre.

When creating a credit slip in the order, using the "partial refund" function, the customer automatically gets an e-mail, which says that a credit slip has been created. The e-mail is based on the template named credit_slip.html.

Is it possible to attach the credit slip as a PDF to this e-mail automatically?

I've been searching the forum, and can see, that I might have to change something in AdminOrdersController. But what should I Change?

Maybe something around line 990?:
 

                            if (!OrderSlip::create($order, $product_list, $shipping, $voucher, $choosen)) {
                                $this->errors[] = Tools::displayError('A credit slip cannot be generated. ');
                            } else {
                                Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list), null, false, true, false, $order->id_shop);
                                @Mail::Send(
                                    (int)$order->id_lang,
                                    'credit_slip',
                                    Mail::l('New credit slip regarding your order', (int)$order->id_lang),
                                    $params,
                                    $customer->email,
                                    $customer->firstname.' '.$customer->lastname,
                                    null,
                                    null,
                                    null,
                                    null,
                                    _PS_MAIL_DIR_,
                                    true,
                                    (int)$order->id_shop
                                );
                            }

Hope you can help...

Best regards,
Mikael

Mikael Mortensen

Mikael Mortensen


Mis-spelling

Hi,

I use Prestashop 1.6, and generate a Credit slip when customers return products from their ordre.

When creating a credit slip in the order, using the "partial refund" function, the customer automatically gets an e-mail, which says that a credit slip has been created. The e-mail is based on the template named credit_slip.html.

Is it possible to attach the credit slip as a PDF to this e-mail automatically?

I've been searching the forum, and can see, that I might have to change something in AdminOrdersController. But what should I Change?

Maybe something around line 990?:
 

                            if (!OrderSlip::create($order, $product_list, $shipping, $voucher, $choosen)) {
                                $this->errors[] = Tools::displayError('A credit slip cannot be generated. ');
                            } else {
                                Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list), null, false, true, false, $order->id_shop);
                                @Mail::Send(
                                    (int)$order->id_lang,
                                    'credit_slip',
                                    Mail::l('New credit slip regarding your order', (int)$order->id_lang),
                                    $params,
                                    $customer->email,
                                    $customer->firstname.' '.$customer->lastname,
                                    null,
                                    null,
                                    null,
                                    null,
                                    _PS_MAIL_DIR_,
                                    true,
                                    (int)$order->id_shop
                                );
                            }

Hope you can help...

Best regards,
Mikael

Mikael Mortensen

Mikael Mortensen

Hi,

I use Prestashop 1.6, and generate a Credit slip when customers return products from their ordre.

When creating a credit slip in the order, using the "partial refund" function, the customer automatically gets an e-mail, which says that a credit slip has been created. The e-mail is based ont he template named credit_slip.html.

Is it possible to attach the credit slip as a PDF to this e-mail automatically?

I've been searching the forum, and can see, that I might have to change something in AdminOrdersController. But what should I Change?

Maybe something around line 990?:
 

                            if (!OrderSlip::create($order, $product_list, $shipping, $voucher, $choosen)) {
                                $this->errors[] = Tools::displayError('A credit slip cannot be generated. ');
                            } else {
                                Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list), null, false, true, false, $order->id_shop);
                                @Mail::Send(
                                    (int)$order->id_lang,
                                    'credit_slip',
                                    Mail::l('New credit slip regarding your order', (int)$order->id_lang),
                                    $params,
                                    $customer->email,
                                    $customer->firstname.' '.$customer->lastname,
                                    null,
                                    null,
                                    null,
                                    null,
                                    _PS_MAIL_DIR_,
                                    true,
                                    (int)$order->id_shop
                                );
                            }

Hope you can help...

Best regards,
Mikael

×
×
  • Create New...