Changeset 3013223
- Timestamp:
- 12/22/2023 08:29:20 AM (2 years ago)
- Location:
- makecommerce/trunk
- Files:
-
- 10 edited
-
README.txt (modified) (2 diffs)
-
makecommerce.php (modified) (2 diffs)
-
payment/gateway/gateway.php (modified) (2 diffs)
-
payment/gateway/woocommerce/woocommerce.php (modified) (1 diff)
-
shipping/method/common/dpd.php (modified) (1 diff)
-
shipping/method/common/lpexpress.php (modified) (1 diff)
-
shipping/method/common/omniva.php (modified) (1 diff)
-
shipping/method/common/smartpost.php (modified) (1 diff)
-
shipping/method/courier/courier.php (modified) (2 diffs)
-
shipping/method/parcelmachine/parcelmachine.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
makecommerce/trunk/README.txt
r3012381 r3013223 4 4 Requires at least: 5.6.1 5 5 Tested up to: 6.3.2 6 Stable tag: 3.4. 06 Stable tag: 3.4.1 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 80 80 81 81 == Changelog == 82 83 = 3.4.1 2023-12-22 = 84 * Fix - Correct hook for payment method title filter 85 * Fix - Parcel machine translation 82 86 83 87 = 3.4.0 2023-12-20 = -
makecommerce/trunk/makecommerce.php
r3012381 r3013223 10 10 * Plugin URI: https://makecommerce.net/ 11 11 * Description: Adds MakeCommerce payment gateway and Itella/Omniva/DPD parcel machine shipping methods to WooCommerce checkout 12 * Version: 3.4. 012 * Version: 3.4.1 13 13 * Author: Maksekeskus AS 14 14 * Author URI: https://makecommerce.net/ … … 32 32 * Start at version 3.0.0 and use SemVer - https://semver.org 33 33 */ 34 define( 'MAKECOMMERCE_VERSION', '3.4. 0' );34 define( 'MAKECOMMERCE_VERSION', '3.4.1' ); 35 35 define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' ); 36 36 -
makecommerce/trunk/payment/gateway/gateway.php
r3012381 r3013223 142 142 143 143 global $woocommerce; 144 144 145 145 // Woocommerce Multilingual overrides 146 146 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 ); 148 148 } 149 149 … … 163 163 * @since 3.0.0 164 164 */ 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; 194 183 } 195 184 -
makecommerce/trunk/payment/gateway/woocommerce/woocommerce.php
r3012381 r3013223 14 14 15 15 public $id = MAKECOMMERCE_PLUGIN_ID; 16 public $version = '3.4. 0';16 public $version = '3.4.1'; 17 17 18 18 public $payment_return_url; -
makecommerce/trunk/shipping/method/common/dpd.php
r3012381 r3013223 35 35 */ 36 36 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' ); 38 38 } 39 39 -
makecommerce/trunk/shipping/method/common/lpexpress.php
r2988356 r3013223 29 29 */ 30 30 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' ); 32 32 } 33 33 } -
makecommerce/trunk/shipping/method/common/omniva.php
r2988356 r3013223 54 54 */ 55 55 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' ); 57 57 } 58 58 } -
makecommerce/trunk/shipping/method/common/smartpost.php
r2988356 r3013223 34 34 */ 35 35 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' ); 37 37 } 38 38 -
makecommerce/trunk/shipping/method/courier/courier.php
r2830541 r3013223 14 14 public $type = "cou"; 15 15 public $identifier = "courier"; 16 public $identifierString; 17 16 18 17 19 /** … … 26 28 27 29 //needed for identifier translation 28 $ courierString = __( "courier", 'wc_makecommerce_domain' );30 $this->identifierString = __( "courier", 'wc_makecommerce_domain' ); 29 31 } 30 32 -
makecommerce/trunk/shipping/method/parcelmachine/parcelmachine.php
r3012381 r3013223 18 18 public $type = "apt"; 19 19 public $identifier = "parcelmachine"; 20 public $identifierString; 21 20 22 21 23 /** … … 63 65 64 66 //needed for identifier translation 65 $ parcelmachineString = __( "parcelmachine", 'wc_makecommerce_domain' );67 $this->identifierString = __( "parcelmachine", 'wc_makecommerce_domain' ); 66 68 } 67 69
Note: See TracChangeset
for help on using the changeset viewer.