<?php $merchant_maximum_order = Yii::app()->functions->getOption("merchant_maximum_order", $merchant_id); ?> <?php if (is_numeric($merchant_maximum_order)) { ?> <?php echo CHtml::hiddenField('merchant_maximum_order', unPrettyPrice($merchant_maximum_order)); echo CHtml::hiddenField('merchant_maximum_order_pretty', baseCurrency() . prettyFormat($merchant_maximum_order)); ?> <p class="uk-text-muted"><?php echo Yii::t("default", "Maximum Order is"); ?> <?php echo displayPrice(baseCurrency(), prettyFormat($merchant_maximum_order, $merchant_id)); ?> </p> <?php } ?> <div class="delivery_options uk-form" style="margin-top:10px;"> <h5><?php echo Yii::t("default", "Delivery Options"); ?> </h5> <?php echo CHtml::dropDownList('delivery_type', $now, (array) Yii::app()->functions->DeliveryOptions($merchant_id)); ?>
?> <?php } ?> <?php if ($data['order_change'] >= 0.1) { ?> <div class="input-block"> <div class="label"><?php echo Yii::t("default", "Change"); ?> :</div> <div class="value"><?php echo displayPrice(baseCurrency(), normalPrettyPrice($data['order_change'])); ?> </div> <div class="clear"></div> </div> <?php $print[] = array('label' => Yii::t("default", "Change"), 'value' => $data['order_change']); ?> <?php } ?> <?php }
public function getCart() { $merchant_id = isset($this->data['mtid']) ? $this->data['mtid'] : ''; if (!is_numeric($merchant_id)) { echo Yii::t("default", "Merchant ID is missing"); return; } $is_merchant_open = Yii::app()->functions->isMerchantOpen($merchant_id); $is_merchant_open1 = $is_merchant_open; $merchant_preorder = Yii::app()->functions->getOption("merchant_preorder", $merchant_id); $disbabled_table_booking = Yii::app()->functions->getOption("merchant_table_booking", $merchant_id); if ($merchant_preorder == 1) { $is_merchant_open = true; } echo CHtml::hiddenField('is_merchant_open', $is_merchant_open == true ? 1 : 2); $close_msg = Yii::app()->functions->getOption("merchant_close_msg", $merchant_id); if (empty($close_msg)) { $close_msg = Yii::t("default", "This restaurant is closed now. Please check the opening times."); } ?> <div class="order-list-wrap"> <h5><?php echo Yii::t("default", "Your Order"); ?> </h5> <div class="item-order-wrap"></div> <!--END item-order-wrap--> <!--VOUCHER STARTS HERE--> <?php //Widgets::applyVoucher($merchant_id); ?> <!--VOUCHER STARTS HERE--> <?php $minimum_order = Yii::app()->functions->getOption('merchant_minimum_order', $merchant_id); ?> <?php if (!empty($minimum_order)) { ?> <?php echo CHtml::hiddenField('minimum_order', unPrettyPrice($minimum_order)); //echo CHtml::hiddenField('minimum_order_pretty',baseCurrency().prettyFormat($minimum_order)) echo CHtml::hiddenField('minimum_order_pretty', prettyFormat($minimum_order)); ?> <p class="uk-text-muted"><?php echo Yii::t("default", "Subtotal must exceed"); ?> <?php echo baseCurrency() . prettyFormat($minimum_order, $merchant_id); ?> </p> <?php } ?> <?php $merchant_maximum_order = Yii::app()->functions->getOption("merchant_maximum_order", $merchant_id); ?> <?php if (is_numeric($merchant_maximum_order)) { ?> <?php echo CHtml::hiddenField('merchant_maximum_order', unPrettyPrice($merchant_maximum_order)); echo CHtml::hiddenField('merchant_maximum_order_pretty', baseCurrency() . prettyFormat($merchant_maximum_order)); ?> <p class="uk-text-muted"><?php echo Yii::t("default", "Maximum Order is"); ?> <?php echo baseCurrency() . prettyFormat($minimum_order, $merchant_id); ?> </p> <?php } ?> <div class="delivery_options uk-form" style="margin-top:10px;"> <h5><?php echo Yii::t("default", "Delivery Options"); ?> </h5> <?php echo CHtml::dropDownList('delivery_type', $now, (array) Yii::app()->functions->DeliveryOptions($merchant_id)); ?> <?php echo CHtml::textField('delivery_date', $now, array('class' => "j_date")); ?> <?php echo CHtml::textField('delivery_time', $now_time, array('class' => "timepick", 'placeholder' => Yii::t("default", "Delivery Time"))); ?> <span class="uk-text-small uk-text-muted"><?php echo Yii::t("default", "Delivery ASAP?"); ?> </span> <?php echo CHtml::checkBox('delivery_asap', false, array('class' => "icheck")); ?> </div> <?php if (yii::app()->functions->validateSellLimit($merchant_id)) { ?> <?php if ($is_merchant_open1) { ?> <a href="javascript:;" class="uk-button checkout"><?php echo Yii::t("default", "Checkout"); ?> </a> <?php } else { ?> <?php if ($merchant_preorder == 1) { ?> <a href="javascript:;" class="uk-button checkout"><?php echo Yii::t("default", "Pre-Order"); ?> </a> <?php } else { ?> <p class="uk-alert uk-alert-warning"><?php echo Yii::t("default", "Sorry merchant is closed."); ?> </p> <p><?php echo prettyDate(date('c'), true); ?> </p> <?php } ?> <?php } ?> <?php } else { ?> <?php $msg = Yii::t("default", "This merchant is not currently accepting orders."); ?> <p class="uk-text-danger"><?php echo $msg; ?> </p> <?php } ?> </div> <!--order-list-wrap--> <?php die; }
$minimum_order = Yii::app()->functions->getOption('merchant_minimum_order', $merchant_id); ?> <?php if (!empty($minimum_order)) { ?> <?php echo CHtml::hiddenField('minimum_order', unPrettyPrice($minimum_order)); echo CHtml::hiddenField('minimum_order_pretty', baseCurrency() . prettyFormat($minimum_order)); ?> <p class="uk-text-muted"><?php echo Yii::t("default", "Subtotal must exceed"); ?> <?php echo baseCurrency() . prettyFormat($minimum_order, $merchant_id); ?> </p> <?php } ?> <div class="spacer2"></div> <a href="javascript:;" class="uk-button uk-button-success place_order"><?php echo Yii::t("default", "Place Order"); ?> </a> </div> <!--order-list-wrap--> </div> <!--grid-2--> <div class="clear"></div>
public function SMSnotificationMerchant($merchant_id = '', $order_info = '', $data = '') { $db_ext = new DbExt(); $sms_enabled_alert = Yii::app()->functions->getOption("sms_enabled_alert", $merchant_id); $sms_notify_number = Yii::app()->functions->getOption("sms_notify_number", $merchant_id); $sms_alert_message = Yii::app()->functions->getOption("sms_alert_message", $merchant_id); $sms_alert_message = $this->smarty("customer-name", $order_info['full_name'], $sms_alert_message); $item_order = ''; if (is_array($data) && count($data) >= 1) { $in_msg = t("OrderNo:") . $order_info['order_id'] . " "; $in_msg .= t("ClientName:") . $order_info['full_name'] . " "; foreach ($data['item'] as $val) { $item_order .= "(" . $val['qty'] . "x)" . $val['item_name'] . " " . $val['order_notes'] . ","; if (is_array($val['sub_item']) && count($val['sub_item']) >= 1) { foreach ($val['sub_item'] as $sub_val) { $item_order .= $sub_val['addon_category'] . ":"; $item_order .= "(" . $sub_val['addon_qty'] . "x)" . $sub_val['addon_name']; $item_order .= ", "; } } } $item_order = substr($item_order, 0, -1); $sms_alert_message = $this->smarty("receipt", $in_msg . $item_order, $sms_alert_message); } $sms_alert_message = $this->smarty("orderno", $order_info['order_id'], $sms_alert_message); $sms_alert_message = $this->smarty("customername", $order_info['full_name'], $sms_alert_message); $sms_alert_message = $this->smarty("customermobile", $order_info['merchant_contact_phone'], $sms_alert_message); $sms_alert_message = $this->smarty("customeraddress", $order_info['full_address'], $sms_alert_message); $sms_alert_message = $this->smarty("amount", displayPrice(baseCurrency(), normalPrettyPrice($order_info['total_w_tax'])), $sms_alert_message); $sms_alert_message = $this->smarty("website-ddress", "http://" . $_SERVER['HTTP_HOST'], $sms_alert_message); $sms_alert_message = $this->smarty("website-address", "http://" . $_SERVER['HTTP_HOST'], $sms_alert_message); //dump($order_info); //send sms to customer $client_sms = Yii::app()->functions->getOption("sms_alert_customer", $merchant_id); $client_contact_phone = $order_info['contact_phone']; if (!empty($client_sms) && !empty($client_contact_phone)) { $client_sms = $this->smarty("customer-name", $order_info['full_name'], $client_sms); $client_sms = $this->smarty("orderno", $order_info['order_id'], $client_sms); $client_sms = $this->smarty("merchantname", $order_info['merchant_name'], $client_sms); $client_sms = $this->smarty("merchantphone", $order_info['merchant_contact_phone'], $client_sms); $client_sms = $this->smarty("website-ddress", "http://" . $_SERVER['HTTP_HOST'], $client_sms); $client_sms = $this->smarty("website-address", "http://" . $_SERVER['HTTP_HOST'], $client_sms); } $sms_provider = Yii::app()->functions->getOptionAdmin('sms_provider'); $sms_provider = strtolower($sms_provider); if ($sms_enabled_alert == 1 && !empty($sms_notify_number) && !empty($sms_alert_message)) { $sms_notify_number_s = explode(",", $sms_notify_number); if (is_array($sms_notify_number_s) && count($sms_notify_number_s) >= 1) { $x_counter = 1; foreach ($sms_notify_number_s as $sms_notify_number) { $balance = $this->getMerchantSMSCredit($merchant_id); if (is_numeric($balance) && $balance >= 1) { //dump($sms_notify_number); $resp = $this->sendSMS($sms_notify_number, $sms_alert_message); $params = array('merchant_id' => $merchant_id, 'broadcast_id' => "999999999", 'client_id' => $order_info['client_id'], 'client_name' => $order_info['full_name'], 'contact_phone' => $sms_notify_number, 'sms_message' => $sms_alert_message, 'status' => $resp['msg'], 'gateway_response' => $resp['raw'], 'date_created' => date('c'), 'date_executed' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'gateway' => $sms_provider); $db_ext->insertData("{{sms_broadcast_details}}", $params); if ($x_counter == 1) { if (!empty($client_sms) && !empty($client_contact_phone)) { $resp2 = $this->sendSMS($client_contact_phone, $client_sms); $params = array('merchant_id' => $merchant_id, 'broadcast_id' => "999999999", 'client_id' => $order_info['client_id'], 'client_name' => $order_info['full_name'], 'contact_phone' => $client_contact_phone, 'sms_message' => $client_sms, 'status' => $resp['msg'], 'gateway_response' => $resp['raw'], 'date_created' => date('c'), 'date_executed' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'gateway' => $sms_provider); $db_ext->insertData("{{sms_broadcast_details}}", $params); } } } $x_counter++; } } } }
?> <li class="child-li li-click2" data-id="bank" data-type="payment-method" data-minimum="<?php echo $wd_bank_minimum; ?> "> <div class="box-grey"> <h4><?php echo t("Bank"); ?> </h4> <div class="inner"> <p><?php echo t("Minimum"); ?> <?php echo displayPrice(baseCurrency(), standardPrettyFormat($wd_bank_minimum)); ?> </p> </div> </div> <!--box--> </li> <?php } ?> </ul> <div class="clear"></div> <div class="bank-info-wrap">
public function initpaymentprovider() { $params = "?method=" . $this->data['payment_opt']; $params .= "&purchase=" . $this->data['purchase']; $params .= "&return_url=" . $this->data['return_url']; $FunctionsK = new FunctionsK(); $merchantinfo = Yii::app()->functions->getMerchantInfo(); switch ($this->data['purchase']) { case "fax_package": $resp = $FunctionsK->getFaxPackagesById($this->data['fax_package_id']); if (!$resp) { $this->msg = t("Package information not found"); return; } if ($resp['promo_price'] >= 1) { $package_price .= $resp['promo_price']; } else { $package_price = $resp['price']; } $credit = $resp['fax_limit']; if ($this->data['payment_opt'] == "pyp" || $this->data['payment_opt'] == "stp") { $params .= "&package_id=" . $this->data['fax_package_id']; //if ( $resp=$FunctionsK->getFaxPackagesById($this->data['fax_package_id'])){ if ($resp) { $params2 = ''; if ($resp['promo_price'] >= 1) { $params2 .= "&price=" . $resp['promo_price']; } else { $params2 .= "&price=" . $resp['price']; } $params2 .= "&description=" . urlencode($resp['title']); $params .= "&raw=" . base64_encode($params2); $this->code = 1; $this->msg = t("Please wait while we redirect you"); $this->details = websiteUrl() . "/merchant/pay/{$params}"; } else { $this->msg = t("Package information not found"); } } elseif ($this->data['payment_opt'] == "obd") { //$merchantinfo=Yii::app()->functions->getMerchantInfo(); if (is_array($merchantinfo) && count($merchantinfo) >= 1) { $merchant_email = $merchantinfo[0]->contact_email; $ref = "FAX_" . Yii::app()->functions->generateRandomKey(8); $params_insert = array('merchant_id' => Yii::app()->functions->getMerchantID(), 'fax_package_id' => $this->data['fax_package_id'], 'payment_type' => Yii::app()->functions->paymentCode("bankdeposit"), 'package_price' => $package_price, 'fax_limit' => $credit, 'payment_reference' => $ref, 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR']); $bank_info = Yii::app()->functions->getBankDepositInstruction(); $tpl = $bank_info['content']; $tpl = smarty('amount', displayPrice(baseCurrency(), standardPrettyFormat($package_price)), $tpl); $tpl = smarty('verify-payment-link', websiteUrl() . "/merchant/faxbankdepositverification/?ref={$ref}", $tpl); if (sendEmail($merchant_email, $bank_info['sender'], $bank_info['subject'], $tpl)) { if ($this->insertData("{{fax_package_trans}}", $params_insert)) { $this->details = websiteUrl() . "/merchant/faxreceipt/id/" . Yii::app()->db->getLastInsertID(); $this->code = 1; $this->msg = t("We have sent bank information instruction to your email") . " :{$merchant_email}"; //$FunctionsK=new FunctionsK(); $FunctionsK->faxSendNotification((array) $merchantinfo[0], $this->data['fax_package_id'], Yii::app()->functions->paymentCode("bankdeposit"), $package_price); } else { $this->msg = t("Error cannot saved information"); } } else { $this->msg = t("Failed cannot send bank payment instructions"); } } else { $this->msg = t("Something went wrong merchant information is empty"); } } else { if ($package_price == 0) { // Free package $params_insert = array('merchant_id' => Yii::app()->functions->getMerchantID(), 'fax_package_id' => $this->data['fax_package_id'], 'payment_type' => 'Free', 'package_price' => $package_price, 'fax_limit' => $credit, 'payment_reference' => '', 'date_created' => date('c'), 'ip_address' => $_SERVER['REMOTE_ADDR'], 'status' => "paid"); if ($this->insertData("{{fax_package_trans}}", $params_insert)) { $this->details = websiteUrl() . "/merchant/faxreceipt/id/" . Yii::app()->db->getLastInsertID(); $this->code = 1; $this->msg = t("Successful"); $FunctionsK->faxSendNotification((array) $merchantinfo[0], $this->data['fax_package_id'], "Free", $package_price); } else { $this->msg = t("Error cannot saved information"); } } else { $this->msg = t("No payment options has been selected"); } } break; default: $this->msg = t("No found instructions"); break; } }