Plugin Directory

Changeset 2930228


Ignore:
Timestamp:
06/23/2023 08:36:54 PM (3 years ago)
Author:
shiptimizeplugins
Message:

v3.1.71 issue with sending checkbox options to the API

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

Legend:

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

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

    r2914515 r2930228  
    361361    // Figure out if this is a local pickup
    362362
    363 
    364363    $shiptimize_carrier = get_post_meta( $this->ShopItemId , 'shiptimize_carrier' , true);
    365364    $settings = '';
     
    422421 
    423422    if ( $settings ) {     
     423      WooShiptimize::log(  $this->ShippingMethodName  . " settings " . var_export($settings,true));
     424
    424425      foreach ($this->shiptimizeOptions->getCheckoutStrIds() as  $fieldstr) {
     426        WooShiptimize::log("CheckOUT  OPTION $fieldstr ");
    425427        $this->checkSimpleOptionWithOrderValue($settings,$fieldstr);
    426428      }
     
    462464   */ 
    463465  protected function checkSimpleOptionWithOrderValue($settings,$optionname) {
    464 
     466    WooShiptimize::log("Checking $optionname");
    465467    if (isset($settings[$optionname]) && $settings[$optionname]) { //can be 0 in checkboxes for "no"
     468
    466469      $optionvalue = $settings[$optionname];
    467470      $childOptionId = 1;
    468471     
     472      WooShiptimize::log("optionvalue $optionvalue");
    469473      if (isset($settings[$optionname . $optionvalue])) {
    470474        $childOptionId = $settings[$optionname . $optionvalue];
     
    479483        }
    480484
    481         if ($option && $option->Value != '-') {
     485        # It's a checkbox or it's an option with a valid value
     486        if (!isset($option->Value) || $option->Value != '-') {
    482487          array_push( $this->OptionList , $option );
    483488        }
  • shiptimize-for-woocommerce/trunk/includes/core/ShiptimizeOptions.php

    r2757277 r2930228  
    6868          '31' => 'sendinsured', # PostNL Pakkatten
    6969          '32' => 'activatepickup', # Activate pickup at seller
     70          '56' => 'activatepickup', # CTT Activate pickup at seller
    7071          '57' => 'sendinsured', # DHL Parcel (2C)
     72          '59' => 'activatepickup', # Activate pickup at seller
    7173          '70' => 'fragile', # CTT Fragile
    72           '56' => 'activatepickup', # CTT Activate pickup at seller
    73           '59' => 'activatepickup', # Activate pickup at seller
    7474        );
    7575    }
     
    8181        $checkboxes = $this->getCheckboxFieldIds();
    8282        $outstr = array();
    83 
    8483        foreach ($checkboxes as $boxid => $boxhandle ) {
    8584            if (!in_array($boxhandle, $outstr)) {
     
    115114            ); 
    116115        }
     116        else if(in_array($optionId, array_keys($this->getCheckboxFieldIds()))) {
     117            $option = array(
     118                'Id' => $optionId,
     119                'Value' => 1
     120            );
     121        }
    117122        else { //default all others to value => 1 which basically just means set
    118123            $option =  array(
     
    137142                );
    138143            }
     144        }
    139145
    140             return $option;
    141         }
     146
     147        return $option;
    142148    }
    143149}
  • shiptimize-for-woocommerce/trunk/includes/core/class-shiptimize-order.php

    r2830540 r2930228  
    427427
    428428        foreach ($errors as $error) {
    429             if( $error->Id == ShiptimizeOrder::$ERROR_ORDER_EXISTS){
     429            if( isset($error->Id) && $error->Id == ShiptimizeOrder::$ERROR_ORDER_EXISTS){
    430430                $this->set_status(ShiptimizeOrder::$STATUS_EXPORTED_SUCCESSFULLY);
    431431                $this->add_message($this->get_formated_message("Order Exists"));
  • shiptimize-for-woocommerce/trunk/readme.txt

    r2914515 r2930228  
    5959== Changelog ==
    6060
     61= 3.1.71 - 2023-06-23 =
     62*  BugFix - Collection option not recognized when exporting.
     63
    6164= 3.1.70 - 2023-05-15 =
    6265*  BugFix - Issue in exporting orders incorrectly assigning a point selection.
  • shiptimize-for-woocommerce/trunk/shiptimize.php

    r2914515 r2930228  
    33 * Plugin Name: Shiptimize for WooCommerce
    44 * Description: Shiptimize for WooCommerce 
    5  * Version: 3.1.70
     5 * Version: 3.1.71
    66 * Author: Shiptimize
    77 * Author URI: https://shiptimize.me
Note: See TracChangeset for help on using the changeset viewer.