driver dumbphone tweaks #2673
This commit is contained in:
parent
e3e664d282
commit
c997238c74
@ -1414,6 +1414,64 @@ class Crunchbutton_Order extends Cana_Table {
|
|||||||
$options = i::o($options);
|
$options = i::o($options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// driver dumbphone tweaks #2673
|
||||||
|
if( $type == 'sms-driver' ){
|
||||||
|
$withOptions = '';
|
||||||
|
$selectOptions = '';
|
||||||
|
|
||||||
|
if ($options->count()) {
|
||||||
|
|
||||||
|
foreach ($dish->options() as $option) {
|
||||||
|
if ($option->option()->type == 'select') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($option->option()->id_option_parent) {
|
||||||
|
$optionGroup = Crunchbutton_Option::o($option->option()->id_option_parent);
|
||||||
|
$selectOptions .= trim( $optionGroup->name ) . ': ';
|
||||||
|
$selectOptions .= trim( $option->option()->name ) . ', ';
|
||||||
|
} else {
|
||||||
|
if( $withOptions == '' ){
|
||||||
|
$withOptions .= 'With: ';
|
||||||
|
}
|
||||||
|
$withOptions .= trim( $option->option()->name ) . ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$withOptions = substr( $withOptions, 0, -2 );
|
||||||
|
$selectOptions = substr( $selectOptions, 0, -2 );
|
||||||
|
}
|
||||||
|
$withoutDefaultOptions = '';
|
||||||
|
if( $dish->id_order_dish && $dish->id_dish ){
|
||||||
|
$optionsNotChoosen = $dish->optionsDefaultNotChoosen();
|
||||||
|
$commas = ' ';
|
||||||
|
if( $optionsNotChoosen->count() ){
|
||||||
|
foreach( $optionsNotChoosen as $dish_option ){
|
||||||
|
$withoutDefaultOptions .= $commas . 'No ' . trim( $dish_option->option()->name );
|
||||||
|
$commas = ', ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( $withOptions != '' || $withoutDefaultOptions != '' || $selectOptions != '' ) {
|
||||||
|
$foodItem .= ': ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $withOptions != '' ){
|
||||||
|
$withOptions .= '. ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $withoutDefaultOptions != '' ){
|
||||||
|
$withoutDefaultOptions .= '. ';
|
||||||
|
}
|
||||||
|
|
||||||
|
if( $selectOptions != '' ){
|
||||||
|
$selectOptions .= '. ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$foodItem .= $withoutDefaultOptions;
|
||||||
|
$foodItem .= $withOptions;
|
||||||
|
$foodItem .= $selectOptions;
|
||||||
|
} else {
|
||||||
if ($options->count()) {
|
if ($options->count()) {
|
||||||
$foodItem .= ' '.$with.' ';
|
$foodItem .= ' '.$with.' ';
|
||||||
|
|
||||||
@ -1445,6 +1503,7 @@ class Crunchbutton_Order extends Cana_Table {
|
|||||||
|
|
||||||
$withoutDefaultOptions .= '.';
|
$withoutDefaultOptions .= '.';
|
||||||
$foodItem .= $withoutDefaultOptions;
|
$foodItem .= $withoutDefaultOptions;
|
||||||
|
}
|
||||||
|
|
||||||
if ($type == 'phone') {
|
if ($type == 'phone') {
|
||||||
$foodItem .= ']]></Say><Pause length="2" /><Say voice="'.c::config()->twilio->voice.'"><![CDATA[';
|
$foodItem .= ']]></Say><Pause length="2" /><Say voice="'.c::config()->twilio->voice.'"><![CDATA[';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user