Plugin Directory

Changeset 857221


Ignore:
Timestamp:
02/13/2014 01:38:45 PM (12 years ago)
Author:
Shipster
Message:

update

Location:
baggage-freight/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • baggage-freight/trunk/baggage_shipping.php

    r808788 r857221  
    207207function post_order($order_id)
    208208{
    209 
    210 
    211209    global $woocommerce;
    212210    global $wpdb;
     211    $prefix = $wpdb->prefix;
    213212       
    214213    $order_obj = new WC_Order( $order_id );
    215214    $special_instruction =  $order_obj->customer_note;
    216215   
    217     $shipping_method = get_post_meta($order_id, '_shipping_method', true);
     216    $shipping_method = get_post_meta($order_id, '_shipping_method', true);
     217   
     218
     219   
     220    if(trim($shipping_method)=="")
     221    {
     222        $sql_Shipping = "select meta_value from ".$prefix."woocommerce_order_itemmeta where order_item_id=".$order_id." and meta_key='method_id'";
     223       
     224       
     225       
     226
     227        $row_Shipping = $wpdb->get_row($sql_Shipping,OBJECT);
     228       
     229        $shipping_method = $row_Shipping->meta_value;
     230    }
     231   
     232   
     233   
     234    $shipping_method = trim($shipping_method);
     235   
     236       
    218237   
    219238   
    220239    if($shipping_method=="bf_shipping" || $shipping_method=="bf_shipping1")
    221240        {
     241           
    222242             
    223243            $sql_setting = "select * from baggage_settings";
     
    347367            'strUrl' => $_SERVER['SERVER_NAME']
    348368            );
     369           
     370       
    349371     
    350372           
     
    358380           
    359381           
    360             if(intval($result)>0)
    361             {
    362            
    363                $BfOrderId = $result;
    364                $insert_order = "insert into baggage_order(Wp_Orderid,BfOrderId) values($order_id,$BfOrderId)";
    365                $wpdb->query($insert_order);
    366            
    367             }
    368382       
    369383      }
     384     
    370385 
    371386 
     
    395410
    396411
    397 echo "<br><br><p>$strLnk</p>";
     412//echo "<br><br><p>$strLnk</p>";
    398413
    399414$result = ob_get_contents();
     
    408423add_action('woocommerce_checkout_update_order_meta', 'post_order');
    409424
     425
     426
    410427add_shortcode('baggage_link', 'post_link');
    411428
  • baggage-freight/trunk/class-wc-baggagefreight.php

    r857050 r857221  
    935935                    'Height' => $Height,         
    936936
    937                     'Unit' => $Unit,             
     937                    'Unit' => $Unit,   
     938                   
     939                    'Server' => $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'],         
    938940
    939941                    'Amount' => $Amount 
    940942
    941943                );   
    942 
    943 
    944944               
     945               
     946
     947
     948               
    945949
    946950                $ch = curl_init('http://www.baggagefreight.com.au/api/apiminrate.aspx');                                                       
     
    958962               
    959963
    960    
     964               
    961965
    962966               
Note: See TracChangeset for help on using the changeset viewer.