Changeset 2882937
- Timestamp:
- 03/19/2023 02:55:09 PM (3 years ago)
- Location:
- delyvax/trunk
- Files:
-
- 5 edited
-
delyvax.php (modified) (2 diffs)
-
functions.php (modified) (4 diffs)
-
includes/delyvax-shipping.php (modified) (2 diffs)
-
includes/shipping-widget.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
delyvax/trunk/delyvax.php
r2879536 r2882937 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.4 66 Version: 1.1.47 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.4 6');15 define('DELYVAX_PLUGIN_VERSION', '1.1.47'); 16 16 17 17 require_once plugin_dir_path(__FILE__) . 'functions.php'; -
delyvax/trunk/functions.php
r2879536 r2882937 52 52 function delyvaxPluginUninstalled() { 53 53 delete_option('delyvax_pricing_enable'); 54 delete_option('delyvax_limit_service_options'); 54 55 delete_option('delyvax_create_shipment_on_paid'); 55 56 delete_option('delyvax_create_shipment_on_confirm'); 56 57 delete_option('delyvax_change_order_status'); 57 58 delete_option('delyvax_company_id'); 59 delete_option('delyvax_company_name'); 58 60 delete_option('delyvax_user_id'); 59 61 delete_option('delyvax_customer_id'); … … 65 67 delete_option('delyvax_shop_mobile'); 66 68 delete_option('delyvax_shop_email'); 69 delete_option('delyvax_shipping_phone'); 67 70 68 71 delete_option('delyvax_processing_days'); … … 74 77 delete_option('delyvax_rate_adjustment_type'); 75 78 79 delete_option('delyvax_insurance_premium'); 80 delete_option('delyvax_source'); 81 delete_option('delyvax_include_order_note'); 82 delete_option('delyvax_cancel_delivery'); 83 delete_option('delyvax_cancel_order'); 84 76 85 delete_option('wc_settings_delyvax_shipping_rate_adjustment'); 77 86 delete_option('delyvax_rate_adjustment_percentage'); … … 155 164 delyvax_set_pickup_delivery_time($order); 156 165 157 if($order->get_status() == 'preparing') 166 if($order->get_status() == 'processing') 167 { 168 if ($settings['create_shipment_on_paid'] == 'yes') 169 { 170 if($order->get_payment_method() != 'pos_cash') { 171 delyvax_create_order($order, $user, true); 172 } 173 }else if ($settings['create_shipment_on_paid'] == 'nothing') 174 { 175 //do nothing 176 }else { 177 if($order->get_payment_method() != 'pos_cash') { 178 delyvax_create_order($order, $user, false); 179 } 180 } 181 }else if($order->get_status() == 'preparing') 158 182 { 159 183 if ($settings['create_shipment_on_confirm'] == 'yes') -
delyvax/trunk/includes/delyvax-shipping.php
r2874200 r2882937 300 300 'title' => __( 'Cancel delivery', 'delyvax' ), 301 301 'default' => __('no', 'delyvax'), 302 'id' => 'delyvax_ shipping_phone',302 'id' => 'delyvax_cancel_delivery', 303 303 'description' => __( 'Cancel the delivery if the order is cancelled. Subject to cancellation rules by the courier.' ), 304 304 'type' => 'select', … … 311 311 'title' => __( 'Cancel order', 'delyvax' ), 312 312 'default' => __('no', 'delyvax'), 313 'id' => 'delyvax_ shipping_phone',313 'id' => 'delyvax_cancel_order', 314 314 'description' => __( 'Cancel the order if the delivery is cancelled.' ), 315 315 'type' => 'select', -
delyvax/trunk/includes/shipping-widget.php
r2879536 r2882937 25 25 $company_code = $settings['company_code']; 26 26 $company_name = $settings['company_name']; 27 $create_shipment_on_paid = $settings['create_shipment_on_paid']; 27 28 $create_shipment_on_confirm = $settings['create_shipment_on_confirm']; 28 29 … … 40 41 41 42 $trackUrl = 'https://'.$company_code.'.delyva.app/customer/strack?trackingNo='.$TrackingCode; 42 $printLabelUrl = 'https://api.delyva.app/v1.0/order/'.$DelyvaXOrderID.'/label?companyId='.$company_id; 43 43 $printLabelUrl = 'https://api.delyva.app/v1.0/order/'.$DelyvaXOrderID.'/label?companyId='.$company_id; 44 45 //processing 46 if ( $order->has_status(array('processing'))) { 47 if($create_shipment_on_paid == 'yes' || $create_shipment_on_paid == '' 48 || $create_shipment_on_confirm == 'yes' ) 49 { 50 //create order and display list of services 51 $DelyvaXServices = $order->get_meta( 'DelyvaXServices' ); 52 53 $adxservices = array(); 54 55 if($DelyvaXOrderID != null && !$DelyvaXServices) 56 { 57 $order = delyvax_get_order_services($order); 58 $DelyvaXServices = $order->get_meta( 'DelyvaXServices' ); 59 } 60 61 if($DelyvaXServices) 62 { 63 $adxservices = json_decode($DelyvaXServices); 64 } 65 66 if($DelyvaXError) { 67 echo "Error: ".$DelyvaXError; 68 } 69 70 if($DelyvaXOrderID != null && sizeof($adxservices) > 0) { 71 delyvax_get_services_select($adxservices, $DelyvaXServiceCode); 72 73 echo '<p><button class="button button-primary" type="submit">Fulfill with '.$company_name.'</button></p>'; 74 } 75 }else { 76 echo "<div><p> 77 <a href=\"".wp_nonce_url( admin_url( 'admin-ajax.php?action=woocommerce_mark_order_status&status=preparing&order_id=' . $order->get_id() ), 'woocommerce-mark-order-status' )."\" class=\"button button-primary\">Fulfill with ".$company_name."</a> 78 </p></div>"; 79 } 80 //preparing 81 } else if ( $order->has_status( array( 'preparing' )) ) { 82 if($DelyvaXOrderID != null && $TrackingCode != null){ 83 echo 'Tracking No.: <b>'.$TrackingCode.'</b>'; 84 echo "<div><p> 85 <a href=\"".$printLabelUrl."\" class=\"button button-primary\" target=\"_blank\">Print label</a> 86 </p></div>"; 87 echo "<div><p> 88 <a href=\"".$trackUrl."\" class=\"button button-primary\" target=\"_blank\">Track shipment</a> 89 </p></div>"; 90 }else { 91 echo "<div> 92 <p> 93 Set your order to <b>Processing</b> to fulfill with ".$company_name.", it also works with <i>bulk actions</i> too! 94 </p> 95 </div>"; 96 } 97 }else if ( $order->has_status( array( 'completed' ) ) ) { 98 if($DelyvaXOrderID != null && $TrackingCode != null){ 99 echo 'Tracking No.: <b>'.$TrackingCode.'</b>'; 100 echo "<div><p> 101 <a href=\"".$trackUrl."\" class=\"button button-primary\" target=\"_blank\">Track shipment</a> 102 </p></div>"; 103 } 104 //others 105 }else { 106 if($DelyvaXOrderID != null && $TrackingCode != null){ 107 echo 'Tracking No.: <b>'.$TrackingCode.'</b>'; 108 echo "<div><p> 109 <a href=\"".$printLabelUrl."\" class=\"button button-primary\" target=\"_blank\">Print label</a> 110 </p></div>"; 111 echo "<div><p> 112 <a href=\"".$trackUrl."\" class=\"button button-primary\" target=\"_blank\">Track shipment</a> 113 </p></div>"; 114 }else { 115 echo "<div> 116 <p> 117 Set your order to <b>Processing</b> to fulfill with ".$company_name.", it also works with <i>bulk actions</i> too! 118 </p> 119 </div>"; 120 } 121 } 122 123 /** 44 124 if ($TrackingCode == 'Service Unavailable') { 45 125 echo 'Tracking No.: <b>'.$TrackingCode.'</b>'; … … 50 130 $adxservices = array(); 51 131 52 if( !$DelyvaXServices)132 if($DelyvaXOrderID && !$DelyvaXServices) 53 133 { 54 134 $order = delyvax_get_order_services($order); … … 78 158 } 79 159 80 delyvax_get_services_select($adxservices, $DelyvaXServiceCode); 81 82 echo '<p><button class="button button-primary" type="submit">Fulfill with '.$company_name.'</button></p>'; 160 if(sizeof($adxservices) > 0) { 161 delyvax_get_services_select($adxservices, $DelyvaXServiceCode); 162 163 echo '<p><button class="button button-primary" type="submit">Fulfill with '.$company_name.'</button></p>'; 164 } 83 165 84 166 // if($create_shipment_on_confirm == 'yes') … … 147 229 </div>"; 148 230 } 231 **/ 149 232 } 150 233 -
delyvax/trunk/readme.txt
r2879536 r2882937 4 4 Requires at least: 5.4 5 5 Tested up to: 6.1 6 Stable tag: 1.1.4 66 Stable tag: 1.1.47 7 7 Requires PHP: 7.2 8 8 License: GPLv3 … … 32 32 33 33 == Changelog == 34 35 = 1.1.47 = 36 *Release Date - 17th March 2023* 37 38 * Bug fixes regarding cancel order and cancel delivery. 34 39 35 40 = 1.1.46 =
Note: See TracChangeset
for help on using the changeset viewer.