Plugin Directory

Changeset 2523812


Ignore:
Timestamp:
04/30/2021 01:25:02 AM (5 years ago)
Author:
delyva
Message:

ef2047f - 1.1.2 - bug-fixes.

Location:
delyvax/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • delyvax/trunk/delyvax.php

    r2521227 r2523812  
    44    Plugin URI: https://delyva.com/solutions
    55    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.1
     6    Version: 1.1.2
    77    Author: DelyvaX
    88    Author URI: https://delyva.com/solutions
  • delyvax/trunk/functions.php

    r2521227 r2523812  
    2121    $weight = WC()->cart->get_cart_contents_weight();
    2222    $min_weight = 0.000; // kg
    23     $max_weight = 10000; // kg
     23    $max_weight = 100000; // kg
    2424
    2525    if($weight > $max_weight){
     
    3131    $weight = WC()->cart->get_cart_contents_weight();
    3232    $min_weight = 0.000; // kg
    33     $max_weight = 10000; // kg
     33    $max_weight = 100000; // kg
    3434
    3535    if($weight < $min_weight) {
     
    516516                  $total_weight = $total_weight + ($product->get_weight()*$quantity);
    517517
    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())));
     518                  $total_dimension = $total_dimension + (delyvax_default_dimension(delyvax_dimension_to_cm($product->get_width()))
     519                        * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_length()))
     520                        * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_height())));
    521521
    522522                  $total_price = $total_price + $total;
     
    596596              $total_weight = $total_weight + ($product->get_weight()*$quantity);
    597597
    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())));
     598              $total_dimension = $total_dimension + ( delyvax_default_dimension(delyvax_dimension_to_cm($product->get_width()))
     599                    * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_length()))
     600                    * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_height())) );
    601601
    602602              $total_price = $total_price + $total;
     
    954954                                  $total_weight = $total_weight + ($product->get_weight()*$quantity);
    955955
    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())));
     956                                  $total_dimension = $total_dimension + (delyvax_default_dimension(delyvax_dimension_to_cm($product->get_width()))
     957                                        * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_length()))
     958                                        * delyvax_default_dimension(delyvax_dimension_to_cm($product->get_height())));
    959959
    960960                                  $total_price = $total_price + $total;
     
    11411141                                          }
    11421142                                      }
    1143                                       // update_post_meta( $this_order_id, $key, $value);
     1143
    11441144                                      //end update sub orders
    11451145                                  }
     
    13321332        }
    13331333    }
     1334}
     1335
     1336function delyvax_dimension_to_cm($length)
     1337{
     1338  $dimension_unit = get_option('woocommerce_dimension_unit');
     1339  // convert other units into cm
     1340  if ($dimension_unit != 'cm') {
     1341      if ($dimension_unit == 'm') {
     1342          return $length * 100;
     1343      } else if ($dimension_unit == 'mm') {
     1344          return $length * 0.1;
     1345      } else if ($dimension_unit == 'in') {
     1346          return $length * 2.54;
     1347      } else if ($dimension_unit == 'yd') {
     1348          return $length * 91.44;
     1349      }
     1350  }
     1351  // already in cm
     1352  return $length;
     1353}
     1354
     1355function delyvax_default_dimension($length)
     1356{
     1357    // default dimension to 1 if it is 0
     1358    return $length > 0 ? $length : 1;
    13341359}
    13351360
  • delyvax/trunk/readme.txt

    r2521227 r2523812  
    44Requires at least: 5.4
    55Tested up to: 5.7
    6 Stable tag: 1.1.1
     6Stable tag: 1.1.2
    77Requires PHP: 7.2
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
    1010
    11 The official DelyvaX plugin helps store owners to integrate WooCommerce with [DelyvaX](https://delyva.com/solutions) for seamless service comparison and order processing.
     11The official DelyvaX plugin helps store owners to integrate WooCommerce with [DelyvaX](https://delyva.com/solutions) delivery management software as a service for seamless service comparison and order processing.
    1212
    1313== Description ==
    1414
    1515DelyvaX WooCommerce plugin
     16- Create shipment automatically on 'payment complete' or manual click to fulfil order.
    1617- Fulfil shipment with 'Preparing' status
    17 - Create shipment automatically on 'payment complete' or manually in fulfil order.
    1818- Edit order > Fulfil order
    1919- Edit order > Print label
    2020- Edit order > Track shipment
    21 - Webhook for preparing, start-collecting, collected, failed-collection, start-delivery, delivered, and failed-delivery.
     21- Auto-status updates with Web-hook for preparing, start-collecting, collected, failed-collection, start-delivery, delivered, and failed-delivery.
    2222
    2323== Installation ==
    2424
    25 1. Get your Company id, User id, Customer id, and API Key from Customer web dashboard > settings > API Integrations.
    26 2. In your woocommerce,  go to DelyvaX Settings > Shipping > DelyvaX
    27 3. Insert your Company id, User id, Customer id, and API Key.
     251. Get your Company id, User id, Customer id, and API Key from your delivery service provider's Customer web dashboard > settings > API Integrations.
     262. In your Woocommerce store admin,  go to Woocommerce > Settings > Shipping > DelyvaX
     273. Insert your delivery service provider's Company code, Company id, User id, Customer id, and API Key.
    28284. Configure the settings as per your requirements.
    2929
    3030== Changelog ==
    3131
     32= 1.1.1 - April 30 2021 = Bug-fixes.
    3233= 1.1.1 - April 26 2021 = Added support for volumetric or actual weight consideration.
    3334= 1.1.0 - April 19 2021 = Bug fixes, and improvements to comply with Wordpress standards.
Note: See TracChangeset for help on using the changeset viewer.