orders page text changes #2810

This commit is contained in:
Pererinha 2015-02-20 16:47:50 -02:00
parent 9be5789f54
commit f21e36e4be
2 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,7 @@ class Crunchbutton_Message_Sms extends Crunchbutton_Message {
const REASON_SUPPORT_SUGGESTION = 'support suggestion';
const REASON_PASSWORD_RESET = 'password reset';
const REASON_DRIVER_SETUP = 'driver setup notify';
const REASON_DRIVER_ORDER_CANCELED = 'driver order canceled';
const REASON_DRIVER_ORDER = 'driver new order';
const REASON_DRIVER_NOTIFIES_CUSTOMER = 'driver notifies customer';
const REASON_DRIVER_SHIFT = 'driver shift';

View File

@ -2151,6 +2151,15 @@ class Crunchbutton_Order extends Crunchbutton_Order_Trackchange {
return $this->_refundedAmount;
}
public function tellDriverTheOrderWasCanceled(){
$driver = $this->getDeliveryDriver();
if( $driver->id_admin && $driver->phone ){
$message = 'Sorry, ' . $this->restaurant()->name . ' order #' . $this->id_order . ' from ' . $this->name . ' was canceled! :(';
Crunchbutton_Support::createNewWarning( [ 'body' => $message, 'phone' => $driver->phone, 'dont_open_ticket' => true ] );
Crunchbutton_Message_Sms::send( [ 'to' => $driver->phone, 'message' => $message, 'reason' => Crunchbutton_Message_Sms::REASON_DRIVER_ORDER_CANCELED ] );
}
}
public function refund() {
if (!$this->refunded){