Jump to content

Disable order confirmation email with BankWire payment. (PaymentModule.php)


xan.s

Recommended Posts

Hello forum,

 

When making an order and choosing the BankWire payment method provided by Prestashop's Module, the customer receives 2 emails, the order_conf and bankwire emails. This process doesn't work for my shop since I need to review the order before actually manually confirming the order by changing it's status.

I've seen multiple threads on this same topic, deactivating the order confirmation email by modifying the PaymentModule.php code, this is the modification I've tried:

Before:

if (Validate::isEmail($this->context->customer->email)) {
                            Mail::Send(
                                (int) $order->id_lang,
                                'order_conf',
                                Context::getContext()->getTranslator()->trans(
                                    'Order confirmation',
                                    array(),
                                    'Emails.Subject',
                                    $orderLanguage->locale
                                ),
                                $data,
                                $this->context->customer->email,
                                $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                null,
                                null,
                                $file_attachement,
                                null,
                                _PS_MAIL_DIR_,
                                false,
                                (int) $order->id_shop
                            );if (Validate::isEmail($this->context->customer->email)) {
                            Mail::Send(
                                (int) $order->id_lang,
                                'order_conf',
                                Context::getContext()->getTranslator()->trans(
                                    'Order confirmation',
                                    array(),
                                    'Emails.Subject',
                                    $orderLanguage->locale
                                ),
                                $data,
                                $this->context->customer->email,
                                $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                null,
                                null,
                                $file_attachement,
                                null,
                                _PS_MAIL_DIR_,
                                false,
                                (int) $order->id_shop
                            );

After:

if (Validate::isEmail($this->context->customer->email)) {
                            Mail::Send(
                                (int) $order->id_lang,
                                'order_conf',
                                Context::getContext()->getTranslator()->trans(
                                    'Order confirmation',
                                    array(),
                                    'Emails.Subject',
                                    $orderLanguage->locale
                                ),
                                $data,
                                $this->context->customer->email,
                                $this->context->customer->firstname . ' ' . $this->context->customer->lastname,
                                null,
                                null,
                                $file_attachement,
                                null,
                                _PS_MAIL_DIR_,
                                false,
                                (int) $order->id_shop
                            );

 

The only thing I've accomplished is my website crashing every time I touch or move this .php, even after leaving it as it was beforehand, my websites crashed and displaying nothing but Error500 on both back and front. The only way of fixing this is restoring a backup.

 

Does anybody know what I can do to:

a) modify the php so it doesn't send that order_conf email.

b) prevent my site from crashing when I modify that php.

 

I appreciate any help beforehand,

Link to comment
Share on other sites

6 minutes ago, xan.s said:

Hey, thank you very much!

 

We've installed your module and testing it, when we confirm the order using bankwire, we get an ERROR 500, here is the debug result:

image.thumb.png.6e7d5ad9f018531a53441e841bd8048f.png

After deactivating Google Analytics Module, it's giving us this error: 

image.thumb.png.38d0c6df48e6012a6d99ee0d23f26359.png

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...