Changeset 2807720
- Timestamp:
- 10/31/2022 08:36:28 AM (3 years ago)
- Location:
- delyvax/trunk
- Files:
-
- 5 edited
-
delyvax.php (modified) (2 diffs)
-
functions.php (modified) (3 diffs)
-
includes/delyvax-api.php (modified) (5 diffs)
-
includes/delyvax-shipping.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
delyvax/trunk/delyvax.php
r2806190 r2807720 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 46 Version: 1.1.35 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 4');15 define('DELYVAX_PLUGIN_VERSION', '1.1.35'); 16 16 17 17 require_once plugin_dir_path(__FILE__) . 'functions.php'; -
delyvax/trunk/functions.php
r2806190 r2807720 378 378 379 379 $multivendor_option = $settings['multivendor']; 380 381 $insurance_premium = $settings['insurance_premium'] ?? ''; 380 382 381 383 //----delivery date & time (pull from meta data), if not available, set to +next day 8am. … … 631 633 632 634 $count++; 633 }634 635 /// check payment method and set codAmount636 $codAmount = 0;637 $codCurrency = $order->get_currency();638 639 if($order->get_payment_method() == 'cod')640 {641 $codAmount = $main_order->get_total();642 635 } 643 636 … … 698 691 ); 699 692 693 // 700 694 $cod = array( 701 "amount" => $codAmount, 702 "currency" => $codCurrency 695 "id"=> -1, 696 "qty"=> 1, 697 "value"=> $total_price 703 698 ); 704 699 705 $resultCreate = DelyvaX_Shipping_API::postCreateOrder($order, $origin, $destination, $weight, $serviceCode, $order_notes, $cod); 700 $insurance = array( 701 "id"=> -3, 702 "qty"=> 1, 703 "value"=> $total_price 704 ); 705 706 $addons = array(); 707 708 if($order->get_payment_method() == 'cod') 709 { 710 array_push($addons, $cod); 711 } 712 713 if($insurance_premium == 'yes') 714 { 715 array_push($addons, $insurance); 716 } 717 // 718 719 $resultCreate = DelyvaX_Shipping_API::postCreateOrder($order, $origin, $destination, $weight, $serviceCode, $order_notes, $addons); 706 720 707 721 if($resultCreate) -
delyvax/trunk/includes/delyvax-api.php
r2804159 r2807720 10 10 11 11 //instant quote 12 public static function getPriceQuote($origin, $destination, $weight, $ cod, $inventories)12 public static function getPriceQuote($origin, $destination, $weight, $addons, $inventories) 13 13 { 14 14 $url = Self::$api_endpoint . "/service/instantQuote/";// . trim(esc_attr($settings['integration_id']), " "); … … 31 31 "weight" => $weight, 32 32 "itemType" => $item_type, 33 "inventory" => $inventories 34 // "cod" => $cod,33 "inventory" => $inventories, 34 "serviceAddon" => $addons 35 35 ]; 36 36 … … 63 63 } 64 64 65 public static function postCreateOrder($order, $origin, $destination, $weight, $serviceCode, $order_notes, $ cod)65 public static function postCreateOrder($order, $origin, $destination, $weight, $serviceCode, $order_notes, $addons) 66 66 { 67 67 $url = Self::$api_endpoint . "/order";// . trim(esc_attr($settings['integration_id']), " "); … … 89 89 'weight' => $weight, 90 90 'note' => $order_notes, 91 // 'cod'=>$cod,91 "serviceAddon" => $addons, 92 92 'source'=> $source 93 93 ]; … … 102 102 'weight' => $weight, 103 103 'note' => $order_notes, 104 // 'cod'=>$cod,104 "serviceAddon" => $addons, 105 105 'source'=> $source 106 106 ]; -
delyvax/trunk/includes/delyvax-shipping.php
r2806190 r2807720 250 250 ) 251 251 ), 252 'insurance_premium' => array( 253 'title' => __( 'Insurance Premium', 'delyvax' ), 254 'id' => 'delyvax_insurance_premium', 255 'description' => __( 'Enable Insurance Premium - subject to additional charge', 'delyvax' ), 256 'type' => 'checkbox', 257 'default' => 'no' 258 ), 252 259 /* 253 260 'weight_option' => array( … … 384 391 $weight_option = $settings['weight_option'] ?? 'BEST'; 385 392 $volumetric_constant = $settings['volumetric_constant'] ?? '5000'; 393 $insurance_premium = $settings['insurance_premium'] ?? ''; 386 394 387 395 $pdestination = $package["destination"]; … … 611 619 612 620 // 613 $codAmount = 0;614 621 $cod = array( 615 "amount" => $codAmount, 616 "currency" => $currency, 622 "id"=> -1, 623 "qty"=> 1, 624 "value"=> $total_amount 617 625 ); 626 627 $insurance = array( 628 "id"=> -3, 629 "qty"=> 1, 630 "value"=> $total_amount 631 ); 632 633 $addons = array(); 634 array_push($addons, $cod); 635 636 if($insurance_premium == 'yes') 637 { 638 array_push($addons, $insurance); 639 } 618 640 619 641 //start DelyvaX API … … 630 652 ) 631 653 { 632 $rates = DelyvaX_Shipping_API::getPriceQuote($origin, $destination, $weight, $ cod, $inventories);654 $rates = DelyvaX_Shipping_API::getPriceQuote($origin, $destination, $weight, $addons, $inventories); 633 655 }else { 634 656 $status_allow_checkout = false; … … 738 760 $service_label = str_replace('(PICKUP)', '', $service_label); 739 761 $service_label = str_replace('(PARCEL)', '', $service_label); 740 $service_label = str_replace('(COD)', '', $service_label);762 // $service_label = str_replace('(COD)', '', $service_label); 741 763 742 764 if($cost == 0) -
delyvax/trunk/readme.txt
r2806190 r2807720 4 4 Requires at least: 5.4 5 5 Tested up to: 5.7 6 Stable tag: 1.1.3 46 Stable tag: 1.1.35 7 7 Requires PHP: 7.2 8 8 License: GPLv3 … … 33 33 == Changelog == 34 34 35 = 1.1.35 = 36 *Release Date - 31st October 2022* 37 38 * Better support for COD & Insurance Cover. 39 35 40 = 1.1.34 = 36 *Release Date - 31stOctober 2022*41 *Release Date - 29th October 2022* 37 42 38 43 * Free shipping feature.
Note: See TracChangeset
for help on using the changeset viewer.