Plugin Directory

Changeset 3013223


Ignore:
Timestamp:
12/22/2023 08:29:20 AM (2 years ago)
Author:
makecommerce
Message:

Release 3.4.1

Location:
makecommerce/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • makecommerce/trunk/README.txt

    r3012381 r3013223  
    44Requires at least: 5.6.1
    55Tested up to: 6.3.2
    6 Stable tag: 3.4.0
     6Stable tag: 3.4.1
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8080
    8181== Changelog ==
     82
     83= 3.4.1 2023-12-22 =
     84* Fix - Correct hook for payment method title filter
     85* Fix - Parcel machine translation
    8286
    8387= 3.4.0 2023-12-20 =
  • makecommerce/trunk/makecommerce.php

    r3012381 r3013223  
    1010 * Plugin URI:            https://makecommerce.net/
    1111 * Description:           Adds MakeCommerce payment gateway and Itella/Omniva/DPD parcel machine shipping methods to WooCommerce checkout
    12  * Version:               3.4.0
     12 * Version:               3.4.1
    1313 * Author:                Maksekeskus AS
    1414 * Author URI:            https://makecommerce.net/
     
    3232 * Start at version 3.0.0 and use SemVer - https://semver.org
    3333 */
    34 define( 'MAKECOMMERCE_VERSION', '3.4.0' );
     34define( 'MAKECOMMERCE_VERSION', '3.4.1' );
    3535define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' );
    3636
  • makecommerce/trunk/payment/gateway/gateway.php

    r3012381 r3013223  
    142142
    143143        global $woocommerce;
    144        
     144
    145145        // Woocommerce Multilingual overrides
    146146        if ( \MakeCommerce\i18n::using_language_plugins() ) {
    147             add_filter( 'get_post_metadata', array( $this, 'override_payment_method_string' ), 5, 4 );
     147            add_filter( 'woocommerce_gateway_title', array( $this, 'override_payment_method_string' ), 25, 2 );
    148148        }
    149149
     
    163163     * @since 3.0.0
    164164     */
    165     public function override_payment_method_string( $check, $object_id, $meta_key, $single ) {
    166        
    167         if ( $meta_key == '_payment_method_title' ) {
    168 
    169             $order = wc_get_order( $object_id );
    170             $payment_method = $order->get_meta( '_payment_method', true );
    171 
    172             if ( $payment_method == 'makecommerce' ) {
    173 
    174                 $language_code = \MakeCommerce\i18n::get_two_char_locale();
    175 
    176                 $title = "";
    177                 //default (no language)
    178                 if ( !empty( $this->settings['ui_widget_title'] ) ) {
    179                     $title = $this->settings['ui_widget_title'];
    180                 }
    181 
    182                 //if method name setting has been set with current language code
    183                 if ( !empty( $this->settings['ui_widget_title_' . $language_code] ) ) {
    184                     $title = $this->settings['ui_widget_title_' . $language_code];
    185                 }
    186 
    187                 if ( $title != "" ) {
    188                     return $title;
    189                 }
    190             }
    191         }
    192 
    193         return $check;
     165    public function override_payment_method_string( $title, $gateway_id ) {
     166
     167        if ($gateway_id === 'makecommerce') {
     168
     169            $language_code = \MakeCommerce\i18n::get_two_char_locale();
     170
     171            //default (no language)
     172            if ( !empty( $this->settings['ui_widget_title'] ) ) {
     173                $title = $this->settings['ui_widget_title'];
     174            }
     175
     176            //if method name setting has been set with current language code
     177            if ( !empty( $this->settings['ui_widget_title_' . $language_code] ) ) {
     178                $title = $this->settings['ui_widget_title_' . $language_code];
     179            }
     180        }
     181
     182        return $title;
    194183    }
    195184
  • makecommerce/trunk/payment/gateway/woocommerce/woocommerce.php

    r3012381 r3013223  
    1414
    1515    public $id = MAKECOMMERCE_PLUGIN_ID;
    16     public $version = '3.4.0';
     16    public $version = '3.4.1';
    1717   
    1818    public $payment_return_url;
  • makecommerce/trunk/shipping/method/common/dpd.php

    r3012381 r3013223  
    3535     */
    3636    public function phone_number_validation_error() {
    37         return '<strong>' . $this->carrier_title . ' ' . $this->identifier . '</strong> ' . __(' can be used with an international phone number only. Please specify your phone number with international country code (e.g. +372xxxxxxx)', 'wc_makecommerce_domain' );
     37        return '<strong>' . $this->carrier_title . ' ' . $this->identifierString . '</strong> ' . __(' can be used with an international phone number only. Please specify your phone number with international country code (e.g. +372xxxxxxx)', 'wc_makecommerce_domain' );
    3838    }
    3939
  • makecommerce/trunk/shipping/method/common/lpexpress.php

    r2988356 r3013223  
    2929     */
    3030    public function phone_number_validation_error() {
    31         return '<strong>' . $this->carrier_title . ' ' . $this->identifier . '</strong> ' . __(' can be used with a Lithuanian phone number only. Please specify your phone number with Lithuanian country code (e.g. +370xxxxxxxx)', 'wc_makecommerce_domain' );
     31        return '<strong>' . $this->carrier_title . ' ' . $this->identifierString . '</strong> ' . __(' can be used with a Lithuanian phone number only. Please specify your phone number with Lithuanian country code (e.g. +370xxxxxxxx)', 'wc_makecommerce_domain' );
    3232    }
    3333}
  • makecommerce/trunk/shipping/method/common/omniva.php

    r2988356 r3013223  
    5454     */
    5555    public function phone_number_validation_error() {
    56         return '<strong>' . $this->carrier_title . ' ' . $this->identifier . '</strong> ' . __(' can only be used with Estonian, Latvian and Lithuanian numbers that are able to receive SMS (mobile phone).', 'wc_makecommerce_domain' );
     56        return '<strong>' . $this->carrier_title . ' ' . $this->identifierString . '</strong> ' . __(' can only be used with Estonian, Latvian and Lithuanian numbers that are able to receive SMS (mobile phone).', 'wc_makecommerce_domain' );
    5757    }
    5858}
  • makecommerce/trunk/shipping/method/common/smartpost.php

    r2988356 r3013223  
    3434     */
    3535    public function phone_number_validation_error() {
    36         return '<strong>' . $this->carrier_title . ' ' . $this->identifier . '</strong> ' . __(' can be used with an international phone number only. Please specify your phone number with international country code (e.g. +372xxxxxxx)', 'wc_makecommerce_domain' );
     36        return '<strong>' . $this->carrier_title . ' ' . $this->identifierString . '</strong> ' . __(' can be used with an international phone number only. Please specify your phone number with international country code (e.g. +372xxxxxxx)', 'wc_makecommerce_domain' );
    3737    }
    3838
  • makecommerce/trunk/shipping/method/courier/courier.php

    r2830541 r3013223  
    1414    public $type = "cou";
    1515    public $identifier = "courier";
     16    public $identifierString;
     17
    1618
    1719    /**
     
    2628
    2729        //needed for identifier translation
    28         $courierString = __( "courier", 'wc_makecommerce_domain' );
     30        $this->identifierString = __( "courier", 'wc_makecommerce_domain' );
    2931    }
    3032
  • makecommerce/trunk/shipping/method/parcelmachine/parcelmachine.php

    r3012381 r3013223  
    1818    public $type = "apt";
    1919    public $identifier = "parcelmachine";
     20    public $identifierString;
     21
    2022
    2123    /**
     
    6365
    6466        //needed for identifier translation
    65         $parcelmachineString = __( "parcelmachine", 'wc_makecommerce_domain' );
     67        $this->identifierString = __( "parcelmachine", 'wc_makecommerce_domain' );
    6668    }
    6769
Note: See TracChangeset for help on using the changeset viewer.