Changeset 2521227
- Timestamp:
- 04/26/2021 02:06:19 AM (5 years ago)
- Location:
- delyvax/trunk
- Files:
-
- 4 edited
-
delyvax.php (modified) (1 diff)
-
functions.php (modified) (5 diffs)
-
includes/delyvax-shipping.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
delyvax/trunk/delyvax.php
r2517977 r2521227 4 4 Plugin URI: https://delyva.com/solutions 5 5 description: The official DelyvaX plugin helps store owners to integrate WooCommerce with [DelyvaX](https://delyva.com/solutions) for seamless service comparison and order processing. 6 Version: 1.1. 06 Version: 1.1.1 7 7 Author: DelyvaX 8 8 Author URI: https://delyva.com/solutions -
delyvax/trunk/functions.php
r2517977 r2521227 424 424 $inventories = array(); 425 425 $total_weight = 0; 426 $total_dimension = 0; 426 427 $total_price = 0; 427 428 $order_notes = ''; … … 514 515 515 516 $total_weight = $total_weight + ($product->get_weight()*$quantity); 517 518 $total_dimension = $total_dimension + ($this->defaultDimension($this->dimensionToCm($product->get_width())) 519 * $this->defaultDimension($this->dimensionToCm($product->get_length())) 520 * $this->defaultDimension($this->dimensionToCm($product->get_height()))); 521 516 522 $total_price = $total_price + $total; 517 523 … … 589 595 590 596 $total_weight = $total_weight + ($product->get_weight()*$quantity); 597 598 $total_dimension = $total_dimension + ($this->defaultDimension($this->dimensionToCm($product->get_width())) 599 * $this->defaultDimension($this->dimensionToCm($product->get_length())) 600 * $this->defaultDimension($this->dimensionToCm($product->get_height()))); 601 591 602 $total_price = $total_price + $total; 592 603 … … 676 687 ); 677 688 689 // 690 691 //calculate volumetric weight 692 $total_actual_weight = $total_weight; 693 694 if($total_dimension > 0) 695 { 696 if($volumetric_constant == 1000) 697 { 698 $total_volumetric_weight = $total_dimension/1000; 699 }else if($volumetric_constant == 6000) 700 { 701 $total_volumetric_weight = $total_dimension/6000; 702 }else { 703 $total_volumetric_weight = $total_dimension/5000; 704 } 705 }else { 706 $total_volumetric_weight = $total_actual_weight; 707 } 708 709 if($weight_option == 'ACTUAL') 710 { 711 $total_weight = $total_actual_weight; 712 }else if($weight_option == 'VOL') 713 { 714 $total_weight = $total_volumetric_weight; 715 }else { 716 if($total_actual_weight > $total_volumetric_weight) 717 { 718 $total_weight = $total_actual_weight; 719 }else { 720 $total_weight = $total_volumetric_weight; 721 } 722 } 723 // 724 678 725 $weight = array( 679 726 "unit" => "kg", … … 906 953 907 954 $total_weight = $total_weight + ($product->get_weight()*$quantity); 955 956 $total_dimension = $total_dimension + ($this->defaultDimension($this->dimensionToCm($product->get_width())) 957 * $this->defaultDimension($this->dimensionToCm($product->get_length())) 958 * $this->defaultDimension($this->dimensionToCm($product->get_height()))); 959 908 960 $total_price = $total_price + $total; 909 961 -
delyvax/trunk/includes/delyvax-shipping.php
r2517977 r2521227 152 152 'description' => __( 'Default order - package item type. e.g. DOCUMENT / PARCEL / FOOD / PACKAGE.' ), 153 153 ), 154 'task_item_type' => array( 155 'title' => __( 'Default Task - Item type', 'delyvax' ), 156 'type' => 'text', 157 'default' => __('0', 'delyvax'), 158 'id' => 'delyvax_task_item_type', 159 'description' => __( 'Default task - package item type. e.g. DOCUMENT / PARCEL / FOOD / PACKAGE.' ), 160 ), 161 'split_tasks' => array( 162 'title' => __( 'Fulfilment by vendors', 'delyvax' ), 163 'id' => 'delyvax_split_tasks', 164 'description' => __( 'Create tasks and assign to vendors by ext id type and ext id', 'delyvax' ), 165 'type' => 'checkbox', 166 'default' => '' 167 ), 168 'ext_id_type' => array( 169 'title' => __( 'Personnel External ID Type', 'delyvax' ), 170 'type' => 'text', 171 'default' => '', 172 'id' => 'delyvax_ext_id_type', 173 'description' => __( 'Personnel External ID Type. e.g. dokan', 'delyvax' ), 174 ), 175 'pickup_minutes' => array( 176 'title' => __( 'Fulfilment minutes before delivery', 'delyvax' ), 177 'type' => 'text', 178 'default' => __('0', 'delyvax'), 179 'id' => 'delyvax_processing_hours', 180 'description' => __( 'Number of minutes before delivery. e.g. 30 - 30 minutes befor delivery time; 60 - 60 minutes befor delivery time.' ), 181 ), 154 'weight_option' => array( 155 'title' => __( 'Weight consideration', 'delyvax' ), 156 'type' => 'text', 157 'default' => __('BEST', 'delyvax'), 158 'id' => 'delyvax_item_type', 159 'description' => __( 'e.g. BEST-Whichever is higher / ACTUAL-Actual weight / VOL-Volumetric Weight.' ), 160 ), 161 'volumetric_constant' => array( 162 'title' => __( 'Volumetric weight constant', 'delyvax' ), 163 'type' => 'text', 164 'default' => __('5000', 'delyvax'), 165 'id' => 'delyvax_item_type', 166 'description' => __( 'e.g. 1000 / 5000 / 6000.' ), 167 ), 168 // 'task_item_type' => array( 169 // 'title' => __( 'Default Task - Item type', 'delyvax' ), 170 // 'type' => 'text', 171 // 'default' => __('0', 'delyvax'), 172 // 'id' => 'delyvax_task_item_type', 173 // 'description' => __( 'Default task - package item type. e.g. DOCUMENT / PARCEL / FOOD / PACKAGE.' ), 174 // ), 175 // 'split_tasks' => array( 176 // 'title' => __( 'Fulfilment by vendors', 'delyvax' ), 177 // 'id' => 'delyvax_split_tasks', 178 // 'description' => __( 'Create tasks and assign to vendors by ext id type and ext id', 'delyvax' ), 179 // 'type' => 'checkbox', 180 // 'default' => '' 181 // ), 182 // 'ext_id_type' => array( 183 // 'title' => __( 'Personnel External ID Type', 'delyvax' ), 184 // 'type' => 'text', 185 // 'default' => '', 186 // 'id' => 'delyvax_ext_id_type', 187 // 'description' => __( 'Personnel External ID Type. e.g. dokan', 'delyvax' ), 188 // ), 189 // 'pickup_minutes' => array( 190 // 'title' => __( 'Fulfilment minutes before delivery', 'delyvax' ), 191 // 'type' => 'text', 192 // 'default' => __('0', 'delyvax'), 193 // 'id' => 'delyvax_processing_hours', 194 // 'description' => __( 'Number of minutes before delivery. e.g. 30 - 30 minutes befor delivery time; 60 - 60 minutes befor delivery time.' ), 195 // ), 182 196 // 'api_webhook_key' => array( 183 197 // 'title' => __('API API Webhook Key', 'delyvax'), … … 232 246 233 247 $total_weight = 0; 248 $total_dimension = 0; 249 $total_volumetric_weight = 0; 234 250 235 251 if (defined('WOOCS_VERSION')) { … … 289 305 290 306 $total_weight = $total_weight + $this->weightToKg($product->get_weight()); 307 308 $total_dimension = $total_dimension + ($this->defaultDimension($this->dimensionToCm($product->get_width())) 309 * $this->defaultDimension($this->dimensionToCm($product->get_length())) 310 * $this->defaultDimension($this->dimensionToCm($product->get_height()))); 291 311 } 292 312 } … … 321 341 $store_country = $split_country[0]; 322 342 $store_state = $split_country[1]; 343 344 $weight_option = $settings['weight_option'] ?? 'BEST'; 345 $volumetric_constant = $settings['volumetric_constant'] ?? '5000'; 323 346 324 347 if(function_exists(dokan_get_seller_id_by_order) && function_exists(dokan_get_store_info)) … … 377 400 ); 378 401 402 //calculate volumetric weight 403 $total_actual_weight = $total_weight; 404 405 if($total_dimension > 0) 406 { 407 if($volumetric_constant == 1000) 408 { 409 $total_volumetric_weight = $total_dimension/1000; 410 }else if($volumetric_constant == 6000) 411 { 412 $total_volumetric_weight = $total_dimension/6000; 413 }else { 414 $total_volumetric_weight = $total_dimension/5000; 415 } 416 }else { 417 $total_volumetric_weight = $total_actual_weight; 418 } 419 420 if($weight_option == 'ACTUAL') 421 { 422 $total_weight = $total_actual_weight; 423 }else if($weight_option == 'VOL') 424 { 425 $total_weight = $total_volumetric_weight; 426 }else { 427 if($total_actual_weight > $total_volumetric_weight) 428 { 429 $total_weight = $total_actual_weight; 430 }else { 431 $total_weight = $total_volumetric_weight; 432 } 433 } 434 // 435 379 436 // 380 437 $weight = array( -
delyvax/trunk/readme.txt
r2517977 r2521227 4 4 Requires at least: 5.4 5 5 Tested up to: 5.7 6 Stable tag: 1.1. 06 Stable tag: 1.1.1 7 7 Requires PHP: 7.2 8 8 License: GPLv3 … … 30 30 == Changelog == 31 31 32 = 1.1.0 - April 19 2022 = Bug fixes, and improvements to comply with Wordpress standards. 32 = 1.1.1 - April 26 2021 = Added support for volumetric or actual weight consideration. 33 = 1.1.0 - April 19 2021 = Bug fixes, and improvements to comply with Wordpress standards. 33 34 = 1.0.0 - August 13 2020 = Initial Release.
Note: See TracChangeset
for help on using the changeset viewer.