Jump to content

[SOLVED] Cash On Delivery - stop "preparation" mail


Recommended Posts

Hi,

I need a tip on how to stop prestashop 1.3.2 from automatically sending "preparation" e-mail to customers, when COD is the method of payment (it automatically sends both "order confirmation" and "preparation" mails).
The "order confirmation" is enough at first step, and for logistical purposes I want to send the "preparation" mail manually.

Any help?

Thank you,

Link to comment
Share on other sites

It is line 16 (in PrestaShop v1.3.2) of modules/cashondelivery/cashondelivery.php that tells PrestaShop to change the state to "Preparation in progress" after the order has been validated:

$cashOnDelivery->validateOrder(intval($cart->id), _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName);



Change _PS_OS_PREPARATION_ to any of the order state variables defined on line 67 of config/defines.inc.php or go to Orders > Statuses to create your own order state and then change _PS_OS_PREPARATION_ above the new order state ID.

Link to comment
Share on other sites

It is line 16 (in PrestaShop v1.3.2) of modules/cashondelivery/cashondelivery.php that tells PrestaShop to change the state to "Preparation in progress" after the order has been validated:

$cashOnDelivery->validateOrder(intval($cart->id), _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName);



Change _PS_OS_PREPARATION_ to any of the order state variables defined on line 67 of config/defines.inc.php or go to Orders > Statuses to create your own order state and then change _PS_OS_PREPARATION_ above the new order state ID.


yes tried to solve this problem for 2 days :)
"_PS_OS_PREPARATION_ " replace sample "15,16,17..."
Link to comment
Share on other sites

  • 6 months later...

It's on line 46 of modules/cashondelivery/validation.php in PrestaShop v1.4.3:

$cashOnDelivery->validateOrder((int)$cart->id, _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName, NULL, array(), NULL, false, $customer->secure_key);

Link to comment
Share on other sites

  • 7 months later...

Hi

 

Sorry that I went back to that, but I have one problem with this.

 

I have made cashondelivery.php file, downloaded and put it as new oder status, but when I changing

 

$cashOnDelivery->validateOrder((int)$cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $cashOnDelivery->displayName, NULL, array(), NULL, false, $customer->secure_key);

 

On

 

$cashOnDelivery->validateOrder((int)$cart->id, Configuration::get('PS_OS_CASHONDELIVERY'), $total, $cashOnDelivery->displayName, NULL, array(), NULL, false, $customer->secure_key);

 

and make order on my website, getting blank site just with working header. And order is not confirmed.

 

Any idea what i have made wrong? I'm not good at this stuff, so I'm sure it is something easy.

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

I am using prestashop 1.5.4.1, and I think I have to modifiy cod.php but don't know how.

 

Would apreciate your help :)

 

 

It's on line 46 of modules/cashondelivery/validation.php in PrestaShop v1.4.3:
 

$cashOnDelivery->validateOrder((int)$cart->id, _PS_OS_PREPARATION_, $total, $cashOnDelivery->displayName, NULL, array(), NULL, false, $customer->secure_key);
Link to comment
Share on other sites

  • 5 months later...

I am using prestashop 1.5.4.1, and I think I have to modifiy cod.php but don't know how.

 

Would apreciate your help :)

 

Hi. In PS 1.5/1.6 You need to replace "Configuration::get('PS_OS_PREPARATION')" with "ID of Your new Order Status" that You make in Back Office.

So in validation.php file placed on modules/cashondelivery/controllers/front find

Configuration::get('PS_OS_PREPARATION') and replace it with Your status ID

 

example

$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);

to

$this->module->validateOrder((int)$this->context->cart->id, 14, $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);
Edited by PrestaShark (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 7 years later...
On 10/16/2014 at 9:22 AM, PrestaShark said:

 

Hi. In PS 1.5/1.6 You need to replace "Configuration::get('PS_OS_PREPARATION')" with "ID of Your new Order Status" that You make in Back Office.

So in validation.php file placed on modules/cashondelivery/controllers/front find

Configuration::get('PS_OS_PREPARATION') and replace it with Your status ID

 

example

$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);

to

$this->module->validateOrder((int)$this->context->cart->id, 14, $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);

I used to to this but after the last update of COD module to v2.0.1 it seems that's not working anymore, it gives me "Fatal error".

This is how the code looks like in the module now:

        $this->module->validateOrder(
            (int) $this->context->cart->id,
            (int) Configuration::getGlobalValue(Ps_Cashondelivery::CONFIG_OS_CASH_ON_DELIVERY),
            (float) $this->context->cart->getOrderTotal(true, Cart::BOTH),
            $this->module->displayName,
            null,
            [],
            (int) $this->context->currency->id,
            false,
            $customer->secure_key
        );

Thanks!

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...