Plugin Directory

Changeset 2816584


Ignore:
Timestamp:
11/11/2022 11:25:39 AM (3 years ago)
Author:
shiptimizeplugins
Message:

v3.1.60 fallback in case plugin is not loaded when shipping method loads

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

Legend:

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

    r2808620 r2816584  
    44define( 'SHIPTIMIZE_API_URL', 'https://api.pakketmail.nl/v3' );
    55define( 'SHIPTIMIZE_BRAND', 'Shiptimize' );
    6 define( 'SHIPTIMIZE_VERSION', '3.1.59' );
     6define( 'SHIPTIMIZE_VERSION', '3.1.60' );
    77define( 'SHIPTIMIZE_CREATE_ACCOUNT', 'https://www.shiptimize.me/quote/' );
    88define( 'SHIPTIMIZE_CHECKOUT', 0);
  • shiptimize-for-woocommerce/trunk/includes/admin/class-shiptimize-shipping.php

    r2800116 r2816584  
    589589  public  function get_option_string($type,$class,$optionname,$defaultvalue='',$options=''){
    590590      $str= "\$this->instance_form_fields['$optionname'] = array(
    591                 'title'             => \$shiptimize->translate('$optionname'),
     591                'title'             => \$translate('$optionname'),
    592592                'type'              => '$type',
    593593                'class'       => '$class',
     
    748748          );
    749749
     750          // Default to returning the string passed by param
     751          \$translate = function (\$str){ return \$str;};
     752
    750753          // how it's possible that someone declares this method before there's an instance of the plugin is a mistery to solve later
    751754          // possible they copied the code and did their own  rendition of the thing?
    752           if(!\$shiptimize) {
     755          if(!\$shiptimize && class_exists('WooShiptimize')) {
    753756            \$shiptimize = WooShiptimize::getInstance();
     757          }
     758
     759          # If we have an instance of shiptimize, then use that translate function
     760          if(\$shiptimize) {
     761            \$translate = function (\$str) { global \$shiptimize; return \$shiptimize->translate(\$str); };
    754762          }
    755763
     
    9971005
    9981006          \$this->init();
    999          
     1007
     1008          // Default to returning the string passed by param
     1009          \$translate = function (\$str){ return \$str;};
     1010
     1011          // how it's possible that someone declares this method before there's an instance of the plugin is a mistery to solve later
     1012          // possible they copied the code and did their own  rendition of the thing?
     1013          if(!\$shiptimize && class_exists('WooShiptimize')) {
     1014            \$shiptimize = WooShiptimize::getInstance();
     1015          }
     1016
     1017          # If we have an instance of shiptimize, then use that translate function
     1018          if(\$shiptimize) {
     1019            \$translate = function (\$str) { global \$shiptimize; return \$shiptimize->translate(\$str); };
     1020          }
     1021
    10001022          /*Service Level*/
    10011023          %s
     
    11941216        public function get_admin_options_html()
    11951217        {
    1196             global \$shiptimize;
    11971218            \$shiptimize_options = json_encode(get_option('wbs_'.\$this->instance_id.'_shiptimize'));
    11981219            $pickup_behaviour_label;
  • shiptimize-for-woocommerce/trunk/readme.txt

    r2808620 r2816584  
    5959== Changelog ==
    6060
     61= 3.1.60 - 2022-11-01 =
     62* Fix - Some shops seem to load shipping methods before the plugin is loaded, triggering an error in trying to use a method in the plugin. We've written a fallback
     63
    6164= 3.1.59 - 2022-11-01 =
    6265* Fix - when sending item weight to the api, send the individual item weight not qty * item_weight
  • shiptimize-for-woocommerce/trunk/shiptimize.php

    r2808620 r2816584  
    33 * Plugin Name: Shiptimize for WooCommerce
    44 * Description: Shiptimize for WooCommerce 
    5  * Version: 3.1.59
     5 * Version: 3.1.60
    66 * Author: Shiptimize
    77 * Author URI: https://shiptimize.me
Note: See TracChangeset for help on using the changeset viewer.