Ejemplo n.º 1
0
	  function updatefield($shipping_charge='',$old_shipping_charge='',$multiplier='',$old_multiplier='',$total='',$choice=''){
	      ob_start();
              $ups = new ups();
              $calc = $ups->estamate_shipping_by_module( 'order' , $_REQUEST['order_id'] , $shipping_charge);
              
              $shipping_type = $shipping_charge;
              $shipping_charge = $calc;
	      switch($choice){
			 case 'shipping':
				 $update_sql_array = array();				
				 $update_sql_array["shipment_type"] = $shipping_type;
                                 $update_sql_array["shipping_charges"] = $shipping_charge;

				 $this->db->update(erp_ORDER,$update_sql_array,'order_id',$_REQUEST[order_id]);
                                 echo $calc;
			 break;
			 case 'multiplier':
				 $update_sql_array = array();				
				 $update_sql_array[multiplier] = $multiplier;
				 $this->db->update(erp_ORDER,$update_sql_array,'order_id',$_REQUEST[order_id]);
			 break;
		   }  /////end of switch
		      $this->total_price = ($this->total_price + $shipping_charge) * $multiplier;
			 // echo $this->total_price.' '.$shipping_charge.' '.$multiplier;
		 
		$html=ob_get_contents();
		ob_end_clean();
		return $html;
	  }  ////////////end of function updatefield
Ejemplo n.º 2
0
	  function updatefield($shipping_charge='',$old_shipping_charge='',$multiplier='',$old_multiplier='',$total='',$choice='',$auto_shipping=''){
	      ob_start();
              $auto_shipping_flag = 0;
			  $ups = new ups();
              
              $shipping_type = $shipping_charge;
                  switch( $shipping_charge ){
                     case "01":
                         $shipping_charge = '75';
                     break;
                     case "02":
                         $shipping_charge = '50';
                     break;
                     case "03":
                         $shipping_charge = '30';
                     break;
					 case "04":
                         $shipping_charge = '0';
                     break;

                 }
				// echo $shipping_charge.'aaaaaaa<br>';
                $shipping_charge=  $ups->estamate_shipping_by_module("order", $_REQUEST['order_id'], $shipping_type);
				
				if($auto_shipping != ''){
					$shipping_charge = $auto_shipping;
					$auto_shipping_flag = 1;
				}
				// echo $shipping_charge.'aaaaaaa<br>';
                //print_r($shipping_charge);
	      switch($choice){
			 case 'shipping':
				 $update_sql_array = array();				
				 $update_sql_array["shipment_type"] = $shipping_type;
                 $update_sql_array["shipping_charges"] = $shipping_charge;
				 $update_sql_array["auto_shipping_charge"] = $auto_shipping_flag;
				 $this->db->update(erp_ORDER,$update_sql_array,'order_id',$_REQUEST[order_id]);
			 break;
			 case 'multiplier':
				 $update_sql_array = array();				
				 $update_sql_array[multiplier] = $multiplier;
				 $this->db->update(erp_ORDER,$update_sql_array,'order_id',$_REQUEST[order_id]);
			 break;
		   }  /////end of switch
		      $this->total_price = ($this->total_price + $shipping_charge) * $multiplier;
		 
		$html=ob_get_contents();
		ob_end_clean();
		return $html;
	  }  ////////////end of function updatefield