Plugin Directory

Changeset 2781393


Ignore:
Timestamp:
09/07/2022 02:13:50 PM (4 years ago)
Author:
shiptimizeplugins
Message:

error in sending the item weight when qty > 1

Location:
shiptimize-for-woocommerce/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • shiptimize-for-woocommerce/trunk/constants.php

    r2773641 r2781393  
    44define( 'SHIPTIMIZE_API_URL', 'https://api.pakketmail.nl/v3' );
    55define( 'SHIPTIMIZE_BRAND', 'Shiptimize' );
    6 define( 'SHIPTIMIZE_VERSION', '3.1.51' );
     6define( 'SHIPTIMIZE_VERSION', '3.1.53' );
    77define( 'SHIPTIMIZE_CREATE_ACCOUNT', 'https://www.shiptimize.me/quote/' );
    88define( 'SHIPTIMIZE_CHECKOUT', 0);
  • shiptimize-for-woocommerce/trunk/includes/class-woo-shiptimize-order.php

    r2773641 r2781393  
    167167    $this->ShipmentItems = array();
    168168
    169 
    170169    foreach( $items as $item ) {   
    171170      $product = $item->get_product();
     
    180179          $productweight = $product->get_weight();
    181180          if(is_numeric($qty) && is_numeric($productweight)) {
    182             $item_weight = wc_get_weight(floatval($qty * $productweight),'g');
     181            $item_weight = wc_get_weight(floatval($productweight),'g');
    183182          }
    184           $weight += $item_weight;
     183         
     184          $weight += $qty * $item_weight; 
    185185        }
    186186   
     
    199199      }
    200200    }
    201  
    202201
    203202    if( $weight > 0 ) {
     
    321320    }
    322321   
    323     if(!$this->Transporter && shiptimize_is_marketplace()){
     322    if (!$this->Transporter && shiptimize_is_marketplace()) {
    324323      $mkp = ShiptimizeMarketplace::instance();
    325324      $transporter = $mkp->get_carrier_for_order($this);
    326       if($transporter > 0) {
     325      if ($transporter > 0) {
    327326        $this->Transporter = $transporter;   
    328327      }
     
    401400   
    402401    $meta = self::get_shipping_meta($this->ShopItemId);
    403     if($meta) {
     402
     403    if ($meta) {
    404404      $this->shiptimize_message = $meta->message;
    405405      $this->shiptimize_status = $meta->status; 
    406406    }
    407407 
    408     if( get_locale() == 'pt_BR' ) {
     408    if ( get_locale() == 'pt_BR' ) {
    409409      $this->set_brazilian_fields();
    410410    }
     
    670670            if( $product->has_weight() ) {
    671671              $item_weight = wc_get_weight(floatval($qty * $product->get_weight()),'g');
    672               $weight += $item_weight;
     672              $weight += $qty * $item_weight;
    673673            }
    674674       
     
    686686        }
    687687
    688         if($replace_total_weight){
     688        if ($replace_total_weight) {
    689689          $this->Weight = $weight;   
    690         }
     690        }
     691         
    691692        return $ShipmentItems;
    692693  }
  • shiptimize-for-woocommerce/trunk/readme.txt

    r2773641 r2781393  
    5858
    5959== Changelog ==
     60
     61= 3.1.53 - 2022-09-07 =
     62* fix - Item weight should be the weight of the item, not the total of the quantity indicated
     63
     64= 3.1.52 - 2022-08-26 =
     65* fix - Total weight did not account for quantity.
     66
    6067= 3.1.51 - 2022-08-19 =
    6168* enhancement - Always round weights down, some shops will define weights with decimals even in grams. The smaller unit of weight which the API accepts is grams.
  • shiptimize-for-woocommerce/trunk/shiptimize.php

    r2773641 r2781393  
    33 * Plugin Name: Shiptimize for WooCommerce
    44 * Description: Shiptimize for WooCommerce 
    5  * Version: 3.1.51
     5 * Version: 3.1.53
    66 * Author: Shiptimize
    77 * Author URI: https://shiptimize.me
Note: See TracChangeset for help on using the changeset viewer.