From 1f5033b4710d9361e02a16e8eb355130b51d9bb0 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Fri, 5 Apr 2024 17:21:06 +0700 Subject: [PATCH] remove [[bills]] if there no bills found --- system/autoload/Message.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/autoload/Message.php b/system/autoload/Message.php index b493eea6..4961eafc 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -125,6 +125,8 @@ class Message } $note .= "Total : " . Lang::moneyFormat($add_cost+$price) . "\n"; $msg = str_replace('[[bills]]', $note, $msg); + }else{ + $msg = str_replace('[[bills]]', '', $msg); } if ($u) { $msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg); @@ -134,9 +136,9 @@ class Message && !empty($message) && in_array($via, ['sms', 'wa']) ) { if ($via == 'sms') { - Message::sendSMS($customer['phonenumber'], $msg); + echo Message::sendSMS($customer['phonenumber'], $msg); } else if ($via == 'wa') { - Message::sendWhatsapp($customer['phonenumber'], $msg); + echo Message::sendWhatsapp($customer['phonenumber'], $msg); } } return "$via: $msg";