Plugin Directory

Changeset 3255337


Ignore:
Timestamp:
03/13/2025 11:56:26 AM (12 months ago)
Author:
webikon
Message:

Fixed parcel weight calculation

Location:
wc-dpd
Files:
101 added
3 edited

Legend:

Unmodified
Added
Removed
  • wc-dpd/trunk/includes/DpdExport.php

    r3254821 r3255337  
    137137        if ($add_parcelshop_data) {
    138138            $services['parcelShopDelivery'] = $parcelshop_data;
     139        }
     140
     141        // Calculate parcel weight
     142        $parcel_weight = 3.0; // Default weight
     143        if (!empty($this->{self::ORDER_PACKAGE_WEIGHT_KEY})) {
     144            $weight = floatval($this->{self::ORDER_PACKAGE_WEIGHT_KEY});
     145            if ($weight > 0) {
     146                $parcel_weight = $weight;
     147            }
    139148        }
    140149
     
    177186                            'parcel' => [
    178187                                0 => [
    179                                     'weight' => $this->{self::ORDER_PACKAGE_WEIGHT_KEY} ?? 3,
     188                                    'weight' => $parcel_weight,
    180189                                    'reference1' => $this->{self::ORDER_REFERENCE_1_KEY},
    181190                                    'reference2' => $this->{self::ORDER_REFERENCE_2_KEY},
  • wc-dpd/trunk/readme.txt

    r3254821 r3255337  
    66Tested up to: 6.7.2
    77Requires PHP: 7.4
    8 Stable tag: 8.0.0
     8Stable tag: 8.0.1
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6262
    6363== Changelog ==
     64
     65= 8.0.1 =
     66* Fixed parcel weight calculation
    6467
    6568= 8.0.0 =
  • wc-dpd/trunk/wc-dpd.php

    r3254821 r3255337  
    44 * Plugin Name: DPD SK for WooCommerce
    55 * Description: DPD SK plugin for WooCommerce which exports orders to the DPD through their API
    6  * Version: 8.0.0
     6 * Version: 8.0.1
    77 * Author: Webikon
    88 * Author URI: https://www.webikon.sk
Note: See TracChangeset for help on using the changeset viewer.