Karenderia Multiple Restaurant System

Karenderia Multiple Restaurant System 5.4.5

No permission to download

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
yes it's a really complete solution for food delivery, but the dev team are working on new entire kmrs code
I am done adding whatsapp notification using wassenger api, but NO wassenger account hahaha... do you know if wassenger have a free account for developers for testing purpose. I know they have 7 days trial, I already used it. don't know if the registration record my ip address or not, if not I can use another email to get another 7 days trial using different phone number.

ps:
Still pending approval from that private group, After waiting for so long, I decided to modify myself.
sms-settings.php
AjaxAdmin.php
Functions.php
 

Attachments

  • karenderia-whatsapp.jpg
    karenderia-whatsapp.jpg
    74.5 KB · Views: 72
Last edited:
  • Like
Reactions: record404 and zack0

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
I currently don't have an active wassenger account, so I have not got a chance to test it.
But I am pretty confident that it will work.

OK there are 3 files need to modify:
1. /protected/views/admin/sms-settings.php

put these code above "<li class="<?php echo $provider_selected=="twilio"?"uk-active":"";?>"><a href="#"><?php echo t("Twilio")?></a></li>"

<!-- [START EDIT** this is for Whatsapp tab] -->
<li class="<?php echo $provider_selected=="whatsapp"?"uk-active":"";?>"><a href="#"><?php echo t("Whatsapp")?></a></li>
<!-- [END EDIT** this is for Whatsapp tab] -->

put these code above <!--TWILIO-->

<!--WHATSAPP-->
<div class="uk-form-row">
<label class="uk-form-label"><?php echo t("Enabled")?></label>
<?php
echo CHtml::radioButton('sms_provider',
$provider_selected=="whatsapp"?true:false
,array(
'class'=>"icheck",
'value'=>"whatsapp"
));
?>
</label>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Phone Number")?></label>
<?php
echo CHtml::textField('whatsapp_phone',
Yii::app()->functions->getOptionAdmin('whatsapp_phone')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Whatsapp Token")?></label>
<?php
echo CHtml::textField('whatsapp_token',
Yii::app()->functions->getOptionAdmin('whatsapp_token')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<br/>
<?php echo t("get your account on")?> <a target="_blank"a href="https://www.wassenger.com/">https://www.wassenger.com/</a>

</li>
<li >

2. /protected/components/AjaxAdmin.php
put this codes above "Yii::app()->functions->updateOptionAdmin("sms_sender_id","

Yii::app()->functions->updateOptionAdmin("whatsapp_phone",
isset($this->data['whatsapp_phone'])?$this->data['whatsapp_phone']:'');
Yii::app()->functions->updateOptionAdmin("whatsapp_token",
isset($this->data['whatsapp_token'])?$this->data['whatsapp_token']:'')


3. /protected/components/Functions.php
put this codes above "case "twilio":"

case "whatsapp":

$whatsapp_phone=getOptionA('whatsapp_phone');
$whatsapp_token=getOptionA('whatsapp_token');
try {
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wassenger.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"phone\":\"$whatsapp_phone\",\"message\":\"$message\"}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Token: " . $whatsapp_token
],
]);
curl_exec($curl);
curl_close($curl);
} catch (Exception $e){
$msg = $e->getMessage();
}
break;
 
Last edited:
  • Like
Reactions: zack0 and shandar

zack0

Member
Nov 11, 2019
41
26
18
I currently don't have an active wassenger account, so I have not got a chance to test it.
But I am pretty confident that it will work.

OK there are 3 files need to modify:
1. /protected/views/admin/sms-settings.php
put these code above <!--TWILIO-->

<!--WHATSAPP-->
<div class="uk-form-row">
<label class="uk-form-label"><?php echo t("Enabled")?></label>
<?php
echo CHtml::radioButton('sms_provider',
$provider_selected=="whatsapp"?true:false
,array(
'class'=>"icheck",
'value'=>"whatsapp"
));
?>
</label>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Phone Number")?></label>
<?php
echo CHtml::textField('whatsapp_phone',
Yii::app()->functions->getOptionAdmin('whatsapp_phone')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Whatsapp Token")?></label>
<?php
echo CHtml::textField('whatsapp_token',
Yii::app()->functions->getOptionAdmin('whatsapp_token')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<br/>
<?php echo t("get your account on")?> <a target="_blank"a href="https://www.wassenger.com/">https://www.wassenger.com/</a>

</li>
<li >

2. /protected/components/AjaxAdmin.php
put this codes above "Yii::app()->functions->updateOptionAdmin("sms_sender_id","

Yii::app()->functions->updateOptionAdmin("whatsapp_phone_number",
isset($this->data['whatsapp_phone_number'])?$this->data['whatsapp_phone_number']:'');

3. /protected/components/Functions.php
put this codes above "case "twilio":"

case "whatsapp":

//require_once "TwilioWrapper.php";
$whatsapp_phone=getOptionA('whatsapp_phone');
//$sms_account_id=getOptionA('sms_account_id');
$whatsapp_token=getOptionA('whatsapp_token');
try {
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wassenger.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"phone\":\"$whatsapp_phone\",\"message\":\"$message\"}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Token: " . $whatsapp_token
],
]);
curl_exec($curl);
curl_close($curl);
} catch (Exception $e){
$msg = $e->getMessage();
}
break;
I have DMd you, hopefully I can contribute
 
  • Love
Reactions: arrocy

Shandar

Active member
Oct 31, 2020
160
56
28
Earth
I currently don't have an active wassenger account, so I have not got a chance to test it.
But I am pretty confident that it will work.

OK there are 3 files need to modify:
1. /protected/views/admin/sms-settings.php
put these code above <!--TWILIO-->

<!--WHATSAPP-->
<div class="uk-form-row">
<label class="uk-form-label"><?php echo t("Enabled")?></label>
<?php
echo CHtml::radioButton('sms_provider',
$provider_selected=="whatsapp"?true:false
,array(
'class'=>"icheck",
'value'=>"whatsapp"
));
?>
</label>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Phone Number")?></label>
<?php
echo CHtml::textField('whatsapp_phone',
Yii::app()->functions->getOptionAdmin('whatsapp_phone')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<div class="uk-form-row">
<label class="uk-form-label"><?php echo Yii::t("default","Whatsapp Token")?></label>
<?php
echo CHtml::textField('whatsapp_token',
Yii::app()->functions->getOptionAdmin('whatsapp_token')
,array(
'class'=>"uk-form-width-large",
//'data-validation'=>"required"
))
?>
</div>
<br/>
<?php echo t("get your account on")?> <a target="_blank"a href="https://www.wassenger.com/">https://www.wassenger.com/</a>

</li>
<li >

2. /protected/components/AjaxAdmin.php
put this codes above "Yii::app()->functions->updateOptionAdmin("sms_sender_id","

Yii::app()->functions->updateOptionAdmin("whatsapp_phone_number",
isset($this->data['whatsapp_phone_number'])?$this->data['whatsapp_phone_number']:'');

3. /protected/components/Functions.php
put this codes above "case "twilio":"

case "whatsapp":

$whatsapp_phone=getOptionA('whatsapp_phone');
$whatsapp_token=getOptionA('whatsapp_token');
try {
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wassenger.com/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"phone\":\"$whatsapp_phone\",\"message\":\"$message\"}",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Token: " . $whatsapp_token
],
]);
curl_exec($curl);
curl_close($curl);
} catch (Exception $e){
$msg = $e->getMessage();
}
break;
it's not saving data ( whatsapp sender id & token )
i created 2 new line on mt_option table
-whatsapp_phone
-whatsapp_token
EDIT:
message sent i can see the message on wassenger dashboard but statut pending
 
Last edited:

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
damn.. it suppose to save to table mt_options.

try to add records manually the database -> table mt_option
id -> whatever number next
merchant_id -> 0 <- this is zero
option_name -> 'whatsapp_phone'
option_value -> put your actual phone number that is registered with wassenger

then add 1 more record
id -> whatever number next
merchant_id -> 0 <- this is zero
option_name -> 'whatsapp_token'
option_value -> put your actual wassenger token
scratch this idea, better import this sql file to add record
then after that, you should be able to save the data.
 

Attachments

  • add-whatsapp_phone-and-whatsapp_token.zip
    325 bytes · Views: 26
  • image_2021-07-20_033848.png
    image_2021-07-20_033848.png
    34.6 KB · Views: 28
  • Like
  • Love
Reactions: shandar and roger17

Shandar

Active member
Oct 31, 2020
160
56
28
Earth
scratch this idea, better import this sql file to add record
then after that, you should be able to save the data.
Already done manualy & received sms test message. but sms order notification not sent, but maybe its a problem from my server, because actually i have problem with autoassign after installing on my vps apache brotoli compression & varnish cache misconfiguration with https, i will do a fresh install & try again
 

iHamed

New member
May 5, 2022
0
0
0
yes I created it, but I found the problem, it was in part 2 of his tutorial, here the correction!


Yii::app()->functions->updateOptionAdmin("whatsapp_phone",
isset($this->data['whatsapp_phone'])?$this->data['whatsapp_phone']:'');
Yii::app()->functions->updateOptionAdmin("whatsapp_token",
isset($this->data['whatsapp_token'])?$this->data['whatsapp_token']:'')
 

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
yes I created it, but I found the problem, it was in part 2 of his tutorial, here the correction!


Yii::app()->functions->updateOptionAdmin("whatsapp_phone",
isset($this->data['whatsapp_phone'])?$this->data['whatsapp_phone']:'');
Yii::app()->functions->updateOptionAdmin("whatsapp_token",
isset($this->data['whatsapp_token'])?$this->data['whatsapp_token']:'')
Oh man... I copy the wrong part of my codes hahahaha
yes, it is suppose to be whatsapp_phone and whatsapp_token, I feel so silly hahahaha....
I corrected the step#2 tutorial.

thank you @thfortes
 
Last edited:
  • Like
Reactions: shandar

iHamed

New member
May 5, 2022
0
0
0
Oh man... I copy the wrong part of my codes hahahaha
yes, it is suppose to be whatsapp_phone and whatsapp_token, I feel so silly hahahaha....
I corrected the step#2 tutorial.

thank you @thfortes
thank you!! what is the possibility to put for the callmebot?

obs: sorry for the writing, i'm using google translator
 
  • Like
Reactions: Donalds duck

iHamed

New member
May 5, 2022
0
0
0
Oh man... I copy the wrong part of my codes hahahaha
yes, it is suppose to be whatsapp_phone and whatsapp_token, I feel so silly hahahaha....
I corrected the step#2 tutorial.

thank you @thfortes
can help with the pain callmebob, I think I'm not getting it right, code below.


case "whatsapp":

$whatsapp_phone=getOptionA('whatsapp_phone');
$whatsapp_token=getOptionA('whatsapp_token');
try {
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.callmebot.com/whatsapp.....'&text='.$message.'&apikey='.$whatsapp_token",
CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($curl);
curl_close($curl);
} catch (Exception $e){
$msg = $e->getMessage();
}
break;
 
  • Like
Reactions: Donalds duck

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
can help with the pain callmebob, I think I'm not getting it right, code below.


case "whatsapp":

$whatsapp_phone=getOptionA('whatsapp_phone');
$whatsapp_token=getOptionA('whatsapp_token');
try {
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.callmebot.com/whatsapp.php?phone='.$whatsapp_phone.'&text='.$message.'&apikey='.$whatsapp_token",
CURLOPT_RETURNTRANSFER => true,
]);
curl_exec($curl);
curl_close($curl);
} catch (Exception $e){
$msg = $e->getMessage();
}
break;
Callmebot has totally different approach in term of way to send notification.

callmebot is acting as an active sender, sending messages to people from "them", not from "you".
That's why they need consent to any phone numbers that they send messages to, because if somebody complained, they have the phone number owner consent.

Now, wassenger is acting as a relay, they use your phone number to send the messages, so if anyone complained, people complain to you, because you are the sender.

Now SMS works the same as wassenger, that's why I choose wassenger for convenience so no need to mod a lot, just add feature becasue the function is already there.

Is it possible to use callmebot api?
yes it is possible. I will learn how to make module on yii framework, I know how to make module on laravel framework, but yii is new to me.
 
  • Like
Reactions: thfortes

iHamed

New member
May 5, 2022
0
0
0
Callmebot has totally different approach in term of way to send notification.

callmebot is acting as an active sender, sending messages to people from "them", not from "you".
That's why they need consent to any phone numbers that they send messages to, because if somebody complained, they have the phone number owner consent.

Now, wassenger is acting as a relay, they use your phone number to send the messages, so if anyone complained, people complain to you, because you are the sender.

Now SMS works the same as wassenger, that's why I choose wassenger for convenience so no need to mod a lot, just add feature becasue the function is already there.

Is it possible to use callmebot api?
yes it is possible. I will learn how to make module on yii framework, I know how to make module on laravel framework, but yii is new to me.
I'm choosing to use callmebob, for reasons of values in Brazil. the dollar is too high for us, the callmebot is the only viable way for us here. I'm studying this too!
 
  • Like
Reactions: Donalds duck

arrocy

Active member
Null Master
Trusted Uploader
Jun 16, 2020
185
213
43
I'm choosing to use callmebob, for reasons of values in Brazil. the dollar is too high for us, the callmebot is the only viable way for us here. I'm studying this too!
Let me see what I can do, cause it is a new learning curve for me about yii.
I can see the controllers and views are in the /protected folder
anyone can tell me which file is executed when the purchase is made?
I haven't got that far after installing karenderia, haven't even finish setup one restaurant item hahaha...
 

Forum statistics

Threads
69,752
Messages
912,238
Members
242,597
Latest member
vectorules

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu