Changeset 2815247
- Timestamp:
- 11/09/2022 02:28:27 PM (3 years ago)
- Location:
- delyvax/trunk
- Files:
-
- 5 edited
-
delyvax.php (modified) (2 diffs)
-
functions.php (modified) (7 diffs)
-
includes/delyvax-shipping.php (modified) (8 diffs)
-
includes/delyvax-webhook.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
delyvax/trunk/delyvax.php
r2810664 r2815247 4 4 Plugin URI: https://delyva.com 5 5 description: The official Delyva plugin helps store owners to integrate WooCommerce with [Delyva](https://delyva.com) for seamless service comparison and order processing. 6 Version: 1.1.3 66 Version: 1.1.37 7 7 Author: Delyva 8 8 Author URI: https://delyva.com … … 13 13 defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); 14 14 define('DELYVAX_API_ENDPOINT', 'https://api.delyva.app/'); 15 define('DELYVAX_PLUGIN_VERSION', '1.1.3 6');15 define('DELYVAX_PLUGIN_VERSION', '1.1.37'); 16 16 17 17 require_once plugin_dir_path(__FILE__) . 'functions.php'; -
delyvax/trunk/functions.php
r2807720 r2815247 472 472 $store_postcode = get_option( 'woocommerce_store_postcode'); 473 473 474 $origin_lat = null; 475 $origin_lon = null; 476 474 477 // The country/state 475 478 if($store_country == null) … … 518 521 $store_postcode = $store_info['address']['zip']; 519 522 $store_country = $store_info['address']['country']; 523 524 $origin_lat = isset($store_info['address']['lat']) ? $store_info['address']['lat'] : null; 525 $origin_lon = isset($store_info['address']['lon']) ? $store_info['address']['lon'] : null; 520 526 } 521 527 }else if($multivendor_option == 'WCFM') … … 540 546 $store_postcode = isset( $store_info['address']['zip'] ) ? $store_info['address']['zip'] : ''; 541 547 $store_country = isset( $store_info['address']['country'] ) ? $store_info['address']['country'] : ''; 548 549 $origin_lat = isset($store_info['address']['lat']) ? $store_info['address']['lat'] : null; 550 $origin_lon = isset($store_info['address']['lon']) ? $store_info['address']['lon'] : null; 542 551 } 543 552 } … … 648 657 "state" => $store_state, 649 658 "postcode" => $store_postcode, 650 "country" => $store_country ,659 "country" => $store_country 651 660 // "coord" => array( 652 661 // "lat" => "", … … 657 666 ); 658 667 668 if($origin_lat && $origin_lon) 669 { 670 $origin['contact']['coord']['lat'] = $origin_lat; 671 $origin['contact']['coord']['lon'] = $origin_lon; 672 } 673 // 674 659 675 //destination 676 $r_shipping_phone = $order->get_meta( 'shipping_phone' ) ? $order->get_meta( 'shipping_phone' ) : $order->get_meta( '_shipping_phone' ); 677 678 $destination_lat = $order->get_meta( 'shipping_lat' ) ? $order->get_meta( 'shipping_lat' ) : null; 679 $destination_lon = $order->get_meta( 'shipping_lon' ) ? $order->get_meta( 'shipping_lon' ) : null; 680 660 681 $destination = array( 661 682 "scheduledAt" => $scheduledAt->format('c'), //"2019-11-15T12:00:00+0800", … … 664 685 "name" => $order->get_shipping_first_name() ? $order->get_shipping_first_name().' '.$order->get_shipping_last_name() : $order->get_billing_first_name().' '.$order->get_billing_last_name(), 665 686 "email" => $order->get_billing_email(), 666 "phone" => $ order->get_billing_phone(),667 "mobile" => $ order->get_billing_phone(),687 "phone" => $r_shipping_phone ? $r_shipping_phone : $order->get_billing_phone(), 688 "mobile" => $r_shipping_phone ? $r_shipping_phone : $order->get_billing_phone(), 668 689 "address1" => $order->get_shipping_address_1() ? $order->get_shipping_address_1() : $order->get_billing_address_1(), 669 690 "address2" => $order->get_shipping_address_2() ? $order->get_shipping_address_2() : $order->get_billing_address_2(), … … 680 701 ); 681 702 703 if($destination_lat && $destination_lon) 704 { 705 $destination['contact']['coord']['lat'] = $destination_lat; 706 $destination['contact']['coord']['lon'] = $destination_lon; 707 } 682 708 // 683 709 -
delyvax/trunk/includes/delyvax-shipping.php
r2810664 r2815247 497 497 $inventories[] = array( 498 498 "weight" => array( 499 "value" => ($this->defaultWeight($this->weightToKg($product _weight))),499 "value" => ($this->defaultWeight($this->weightToKg($product->get_weight()))), 500 500 "unit" => 'kg' 501 501 ), … … 540 540 $store_country = $split_country[0]; 541 541 $store_state = $split_country[1]; 542 543 $origin_lat = null; 544 $origin_lon = null; 542 545 543 546 if($multivendor_option == 'DOKAN') … … 563 566 $store_postcode = $store_info['address']['zip']; 564 567 $store_country = $store_info['address']['country']; 568 569 $origin_lat = isset($store_info['address']['lat']) ? $store_info['address']['lat'] : null; 570 $origin_lon = isset($store_info['address']['lon']) ? $store_info['address']['lon'] : null; 565 571 } 566 572 } … … 587 593 $store_postcode = isset( $store_info['address']['zip'] ) ? $store_info['address']['zip'] : ''; 588 594 $store_country = isset( $store_info['address']['country'] ) ? $store_info['address']['country'] : ''; 595 596 $origin_lat = isset($store_info['address']['lat']) ? $store_info['address']['lat'] : null; 597 $origin_lon = isset($store_info['address']['lon']) ? $store_info['address']['lon'] : null; 589 598 } 590 599 } … … 593 602 } 594 603 604 // 595 605 $origin = array( 596 606 "address1" => $store_address_1, … … 599 609 "state" => $store_state, 600 610 "postcode" => $store_postcode, 601 "country" => $store_country ,611 "country" => $store_country 602 612 // "coord" => array( 603 613 // "lat" => "", … … 606 616 ); 607 617 618 if($origin_lat && $origin_lon) 619 { 620 $origin['coord']['lat'] = $origin_lat; 621 $origin['coord']['lon'] = $origin_lon; 622 } 623 // 624 625 //destination 608 626 $destination = array( 609 627 "address1" => $pdestination["address"], … … 618 636 // ) 619 637 ); 638 639 $destination_lat = isset($pdestination['lat']) ? $pdestination['lat'] : null; 640 $destination_lon = isset($pdestination['lon']) ? $pdestination['lon'] : null; 641 642 if($destination_lat && $destination_lon) 643 { 644 $destination['coord']['lat'] = $destination_lat; 645 $destination['coord']['lon'] = $destination_lon; 646 } 647 // 620 648 621 649 //calculate volumetric weight -
delyvax/trunk/includes/delyvax-webhook.php
r2806190 r2815247 114 114 $consignmentNo = $data['consignmentNo']; 115 115 $statusCode = $data['statusCode']; 116 $statusCode = $data['statusCode'];117 116 118 117 if(strlen($shipmentId) < 3 || strlen($consignmentNo) < 3 ) … … 138 137 $order->get_status(); 139 138 139 $labelUrl = 'https://api.delyva.app/v1.0/order/'.$shipmentId.'/label?companyId='.$company_id; 140 140 141 // $order->update_meta_data( 'DelyvaXOrderID', $shipmentId ); 141 142 $order->update_meta_data( 'DelyvaXTrackingCode', $consignmentNo ); 143 $order->update_meta_data( 'DelyvaXLabelUrl', $labelUrl ); 142 144 $order->save(); 143 145 -
delyvax/trunk/readme.txt
r2810664 r2815247 4 4 Requires at least: 5.4 5 5 Tested up to: 5.7 6 Stable tag: 1.1.3 66 Stable tag: 1.1.37 7 7 Requires PHP: 7.2 8 8 License: GPLv3 … … 32 32 33 33 == Changelog == 34 35 = 1.1.37 = 36 *Release Date - 3rd November 2022* 37 38 * Bug-fixes. 34 39 35 40 = 1.1.36 =
Note: See TracChangeset
for help on using the changeset viewer.