Update and new files for karenderia mobileapp version 2 modules (1.5.3)

Modules

Updated files

  1. components/DriverWrapper.php
  2. components/GraphicalTracking.php
  3. components/mobileWrapper.php
  4. controllers/ApiController.php
  5. translation-file/mobile2.php
  6. Mobileappv2Module.php

Mobile app files

Updated files

  1. www/css/app.css
  2. www/js/app.js
  3. www/js/template.js
  4. www/index.html
  5. config.xml

Database update

  1. No - changes

Update KMRS with new merchant settings

  1. Update the file views/merchant/settings.php with this click here to get the code
  2. open the file components/ajaxadmin.php in function merchantSettings()
    before this line
    
    $this->code=1;
    $this->msg=Yii::t("default","Settings saved.");
    
    add this
    
    Yii::app()->functions->updateOption("tracking_estimation_delivery1",
    isset($this->data['tracking_estimation_delivery1'])?(integer)$this->data['tracking_estimation_delivery1']:0
    ,$merchant_id);  
    
    Yii::app()->functions->updateOption("tracking_estimation_delivery2",
    isset($this->data['tracking_estimation_delivery2'])?(integer)$this->data['tracking_estimation_delivery2']:0
    ,$merchant_id);  
    
    Yii::app()->functions->updateOption("tracking_estimation_pickup1",
    isset($this->data['tracking_estimation_pickup1'])?(integer)$this->data['tracking_estimation_pickup1']:0
    ,$merchant_id);  
    
    Yii::app()->functions->updateOption("tracking_estimation_pickup2",
    isset($this->data['tracking_estimation_pickup2'])?(integer)$this->data['tracking_estimation_pickup2']:0
    ,$merchant_id);  
    
    Yii::app()->functions->updateOption("tracking_estimation_dinein1",
    isset($this->data['tracking_estimation_dinein1'])?(integer)$this->data['tracking_estimation_dinein1']:0
    ,$merchant_id);  
    
    Yii::app()->functions->updateOption("tracking_estimation_dinein2",
    isset($this->data['tracking_estimation_dinein2'])?(integer)$this->data['tracking_estimation_dinein2']:0
    ,$merchant_id);  
    
  3. same file ajaxadmin.php function merchantSettings() add the close_store after the line
    'delivery_distance_covered'=>isset($this->data['merchant_delivery_miles'])?(float)$this->data['merchant_delivery_miles']:0,
    
    add
    
    'close_store'=>isset($this->data['merchant_close_store'])?1:0
    
    
    full code
    
    $params=array(
      'delivery_charges'=>is_numeric($this->data['merchant_delivery_charges'])?$this->data['merchant_delivery_charges']:0,
      'minimum_order'=>is_numeric($this->data['merchant_minimum_order'])?$this->data['merchant_minimum_order']:0,
      'delivery_minimum_order'=>is_numeric($this->data['merchant_minimum_order'])?$this->data['merchant_minimum_order']:0,
      'delivery_maximum_order'=>is_numeric($this->data['merchant_maximum_order'])?$this->data['merchant_maximum_order']:0,
      'pickup_minimum_order'=>is_numeric($this->data['merchant_minimum_order_pickup'])?$this->data['merchant_minimum_order_pickup']:0,
      'pickup_maximum_order'=>is_numeric($this->data['merchant_maximum_order_pickup'])?$this->data['merchant_maximum_order_pickup']:0,
      'logo'=>isset($this->data['photo'])?$this->data['photo']:'',
      'delivery_estimation'=>isset($this->data['merchant_delivery_estimation'])?$this->data['merchant_delivery_estimation']:'',	    	  
      'distance_unit'=>isset($this->data['merchant_distance_type'])?$this->data['merchant_distance_type']:'',
      'delivery_distance_covered'=>isset($this->data['merchant_delivery_miles'])?(float)$this->data['merchant_delivery_miles']:0,
      'close_store'=>isset($this->data['merchant_close_store'])?1:0
    );	    	
    
    

Update merchant app v2 api

  1. open the file merchantappv2/controllers/ApiController.php
    look for function actionOrderDetails()
    before the line
    
    $this->code = 1; $this->msg = "OK";
    
    add this
    
    Yii::app()->db->createCommand()->update("{{order}}",array(
    	'merchantapp_viewed'=>1,
    	'viewed'=>1
    ),
    'order_id=:order_id',
        array(
          ':order_id'=>$order_id
        )
    );