Plugin Directory

Changeset 3408969


Ignore:
Timestamp:
12/03/2025 07:41:02 AM (6 weeks ago)
Author:
aarsiv
Message:

Bug fix

Location:
a2z-dhl-express-shipping
Files:
1617 added
2 edited

Legend:

Unmodified
Added
Removed
  • a2z-dhl-express-shipping/trunk/a2zdhlexpress_basic.php

    r3397772 r3408969  
    44 * Plugin URI: https://myshipi.com/
    55 * Description: Realtime Shipping Rates, Shipping label, Pickup, commercial invoice automation included.
    6  * Version: 5.5.9
     6 * Version: 5.6.0
    77 * Author: Shipi
    88 * Author URI: https://myshipi.com/
     
    453453                                        $product_data = $item->get_data();
    454454
     455                                        $refunded_qty = $order->get_qty_refunded_for_item( $item->get_id() );
     456                                        $remaining_qty = $product_data['quantity'] - abs($refunded_qty);
     457
     458                                        if ($remaining_qty <= 0) {
     459                                            continue;
     460                                        }
     461
    455462                                        $product = array();
    456463                                        $product['product_name'] = str_replace('"', '', $product_data['name']);
    457                                         $product['product_quantity'] = $product_data['quantity'];
     464                                        $product['product_quantity'] = $remaining_qty;
    458465                                        $product['product_id'] = $product_data['product_id'];
    459466
     
    534541                                        }
    535542                                        $product['sku'] =  $getproduct->get_sku();
    536                                         $product['price'] = (isset($product_data['total']) && isset($product_data['quantity'])) ? number_format(($product_data['total'] / $product_data['quantity']), 2) : 0;
     543                                        $refunded_total = $order->get_total_refunded_for_item( $item->get_id() );
     544                                        $remaining_total = $product_data['total'] - abs($refunded_total);
     545                                        $product['price'] = (isset($remaining_total) && $remaining_total > 0) ? round($remaining_total/$remaining_qty, 2): $getproduct->get_price();
    537546                                       
    538547
     
    17591768                            foreach ($order_ids as $order_id) {
    17601769                                $order = wc_get_order( $order_id );
    1761                                 $order->update_status( 'processing' );
     1770                                if ($order) {
     1771                                    $order->update_status( 'processing' );
     1772                                }
    17621773                            }
    17631774                        }else if($action == 'completed'){
    17641775                            foreach ($order_ids as $order_id) {
    17651776                                  $order = wc_get_order( $order_id );
    1766                                   $order->update_status( 'completed' );
    1767                                    
     1777                                  if ($order) {
     1778                                      $order->update_status( 'completed' );
     1779                                  }
    17681780                            }
    17691781                        }
     
    44624474                foreach ( $items as $item ) {
    44634475                    $product_data = $item->get_data();
     4476
     4477                    $refunded_qty = $order->get_qty_refunded_for_item( $item->get_id() );
     4478                    $remaining_qty = $product_data['quantity'] - abs($refunded_qty);
     4479
     4480                    if ($remaining_qty <= 0) {
     4481                        continue;
     4482                    }
     4483
    44644484                    $product = array();
    44654485                    $product['product_name'] = str_replace('"', '', $product_data['name']);
    4466                     $product['product_quantity'] = $product_data['quantity'];
     4486                    $product['product_quantity'] = $remaining_qty;
    44674487                    $product['product_id'] = $product_data['product_id'];
    44684488
     
    45284548
    45294549                    $product['sku'] =  $getproduct->get_sku();
    4530                     $product['price'] = (isset($product_data['total']) && isset($product_data['quantity'])) ? round(($product_data['total'] / $product_data['quantity']), 2) : 0;
     4550                    $refunded_total = $order->get_total_refunded_for_item( $item->get_id() );
     4551                    $remaining_total = $product_data['total'] - abs($refunded_total);
     4552                    $product['price'] = (isset($remaining_total) && $remaining_total > 0) ? round($remaining_total/$remaining_qty, 2): $getproduct->get_price();
    45314553                   
    45324554
  • a2z-dhl-express-shipping/trunk/readme.txt

    r3397772 r3408969  
    55Tested up to: 6.8
    66Requires PHP: 5.6
    7 Stable tag: 5.5.9
     7Stable tag: 5.6.0
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9292
    9393== Changelog ==
     94= 5.6.0 =
     95* Bug fixes
    9496= 5.5.9 =
    9597* Bug fixes
Note: See TracChangeset for help on using the changeset viewer.