Changeset 2426319
- Timestamp:
- 11/26/2020 07:20:49 AM (5 years ago)
- Location:
- hubbed
- Files:
-
- 48 added
- 1 deleted
- 2 edited
-
tags/2.3 (added)
-
tags/2.3/assets (added)
-
tags/2.3/assets/admin (added)
-
tags/2.3/assets/admin/script.js (added)
-
tags/2.3/assets/admin/style.css (added)
-
tags/2.3/assets/bootstrap (added)
-
tags/2.3/assets/bootstrap/css (added)
-
tags/2.3/assets/bootstrap/css/bootstrap.css (added)
-
tags/2.3/assets/bootstrap/css/bootstrap.min.css (added)
-
tags/2.3/assets/bootstrap/js (added)
-
tags/2.3/assets/bootstrap/js/bootstrap.bundle.js (added)
-
tags/2.3/assets/bootstrap/js/bootstrap.bundle.min.js (added)
-
tags/2.3/assets/bootstrap/js/bootstrap.min.js (added)
-
tags/2.3/assets/customcss1.png (added)
-
tags/2.3/assets/customcss2.png (added)
-
tags/2.3/assets/datatables.min.css (added)
-
tags/2.3/assets/datatables.min.js (added)
-
tags/2.3/assets/front (added)
-
tags/2.3/assets/front/close.svg (added)
-
tags/2.3/assets/front/collection.svg (added)
-
tags/2.3/assets/front/gift.svg (added)
-
tags/2.3/assets/front/location.svg (added)
-
tags/2.3/assets/front/pinicon.svg (added)
-
tags/2.3/assets/front/script.js (added)
-
tags/2.3/assets/front/search.svg (added)
-
tags/2.3/assets/front/style.css (added)
-
tags/2.3/assets/hubbed-bd-logo-hover.png (added)
-
tags/2.3/assets/hubbed-bd-logo.png (added)
-
tags/2.3/assets/logo.png (added)
-
tags/2.3/assets/screenshot-1.png (added)
-
tags/2.3/assets/screenshot-2.png (added)
-
tags/2.3/assets/screenshot-3.png (added)
-
tags/2.3/assets/screenshot-3a.png (added)
-
tags/2.3/assets/screenshot-4.png (added)
-
tags/2.3/assets/screenshot-5.png (added)
-
tags/2.3/assets/screenshot-5a.png (added)
-
tags/2.3/assets/screenshot-6.png (added)
-
tags/2.3/assets/screenshot-7.png (added)
-
tags/2.3/assets/screenshot-8.png (added)
-
tags/2.3/assets/screenshot-9.png (added)
-
tags/2.3/hubbed.php (added)
-
tags/2.3/includes (added)
-
tags/2.3/includes/hubbed-order-list.php (added)
-
tags/2.3/includes/hubbed_admin.php (added)
-
tags/2.3/includes/location-popup.php (added)
-
tags/2.3/includes/search_list.php (added)
-
tags/2.3/readme.txt (added)
-
tags/2.3/uninstall.php (added)
-
trunk/assets/admin/script.js (modified) (2 diffs)
-
trunk/hubbed.php (modified) (7 diffs)
-
trunk/includes/order-post.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
hubbed/trunk/assets/admin/script.js
r2399478 r2426319 113 113 114 114 // Generate Tracking No. and Consignment no. 115 115 /* 116 116 jQuery('#hubbed_order_fullfill_button').on("click", function() { 117 117 var hubbed_enable_order_id = jQuery('#hubbed_enable_order_id').val(); … … 147 147 148 148 }); 149 */ 149 150 150 151 // Hubbed Price change -
hubbed/trunk/hubbed.php
r2413241 r2426319 4 4 Plugin URI: https://hubbed.com.au 5 5 Description: HUBBED has developed a number of technology solutions that allow carriers and merchants to seamlessly integrate into the HUBBED collection point networks, and deliver various services to the delight of their customers. 6 Version: 2. 26 Version: 2.3 7 7 Author: HUBBED 8 8 Author URI: http://hubbed.com.au/ 9 9 */ 10 10 if ( ! defined( 'ABSPATH' ) ) exit; 11 11 12 define('HUBBED_APP_URL', 'https://apps.hubbed.com.au'); 12 13 define('HUBBED_CLIENT_API_URL', 'https://production-api.hubbed.com.au/v1/'); 13 14 define('HUBBED_WEB_URL', 'https://clickandcollect.hubbed.com/wp-json/hubbedzohoapi/v1/'); 15 14 16 define('Hubbed_API_URL', HUBBED_APP_URL.'/api'); 15 17 define('Hubbed_DIR', plugin_dir_path(__FILE__)); … … 154 156 } 155 157 require_once 'includes/search_list.php'; 156 require_once 'includes/order-post.php';158 157 159 158 160 … … 330 332 global $wpdb; 331 333 session_start(); 334 $hubbed_id = ""; 332 335 $user_id = get_current_user_id(); 333 336 if(isset($_POST['hubbed_checkout_address_feild']) && !empty($_POST['hubbed_checkout_address_feild'])) 334 337 { 338 339 $articles = array(); 340 $count = 0; 341 $order = wc_get_order( $order_id ); 342 foreach ( $order->get_items() as $item ) 343 { 344 $product_id = absint($item['product_id']); 345 $product = wc_get_product( $product_id ); 346 $productweight = $product->get_weight(); 347 $weight = 1; 348 if ( empty($productweight) or $productweight < 1) 349 { 350 $weight = 1; 351 }else{ 352 $weight = $product->get_weight(); 353 } 354 $sku = $product->get_sku(); 355 if(empty($sku)){ 356 $sku = $product->get_id(); 357 } 358 $articles[$count]["barcode"] = ($sku.'_'.get_post_meta( $hubbed_enable_order_id, 'hubbed_client_id', true )); 359 $articles[$count]["volume"]= (($item ->get_quantity() != null) ? $item ->get_quantity() : ''); 360 $articles[$count]["weight"]= $weight; 361 $count++; 362 } 363 335 364 //$hubbed_address = $_SESSION['hubbed_selectaddress']; 336 365 … … 386 415 $gethubbedid = json_decode($body, true); 387 416 $hubbed_id = $gethubbedid['result']['success']['hubbed_id']; 388 417 update_post_meta( $order_id, 'hubbed_consignment_no',$hubbed_id); 418 389 419 if (empty($hubbed_id)) { 390 420 $response = wp_remote_get($path2, $apidata1); … … 412 442 } 413 443 414 update_post_meta($order_id,'_shipping_company',$_SESSION['hubbed_company'] . " - HUBBED");444 update_post_meta($order_id,'_shipping_company',$_SESSION['hubbed_company']); 415 445 update_post_meta($order_id,'_shipping_address_1',$_SESSION['hubbed_address']); 416 446 update_post_meta($order_id,'_shipping_city',$_SESSION['hubbed_city']); … … 460 490 }else{ $hubbed_city = $_SESSION['hubbed_city']; } 461 491 462 $hubbed_address = $firstname.' '.$lastname.'|'.$_SESSION['hubbed_company'].' - HUBBED|'.$hubbed_street.'|'.$hubbed_city.' , '.$_SESSION['hubbed_state'].'|'.$_SESSION['hubbed_country'].' , '. $_SESSION['hubbed_zip'];492 $hubbed_address = $firstname.' '.$lastname.'|'.$_SESSION['hubbed_company'].'|'.$hubbed_street.'|'.$hubbed_city.' , '.$_SESSION['hubbed_state'].'|'.$_SESSION['hubbed_country'].' , '. $_SESSION['hubbed_zip']; 463 493 464 494 … … 495 525 $passdata['hubbedid'] = $hubbed_id; 496 526 $passdata['storedlb'] = $hubbed_hubbedlb; 527 $passdata['articles'] = ((isset($articles) && $articles != null) ? $articles : []); 497 528 $body = hubbed_api_call('/order/create', $passdata); 498 529 update_post_meta($order_id ,'error',$body); 530 if (isset($body['result'][0]) && $body['result'][0]['responseCode'] == 200 ) 531 { 532 update_post_meta( $order_id, 'hubbed_consignment_status','success'); 533 } 534 else 535 { 536 update_post_meta( $order_id, 'hubbed_consignment_status','error'); 537 538 } 539 499 540 } 500 541
Note: See TracChangeset
for help on using the changeset viewer.