Changeset 3029601
- Timestamp:
- 01/31/2024 04:01:23 PM (2 years ago)
- Location:
- bpost-shipping/trunk
- Files:
-
- 5 edited
-
bpost-shipping.php (modified) (3 diffs)
-
classes/class-wc-bpost-shipping-hooks.php (modified) (5 diffs)
-
composer.json (modified) (1 diff)
-
languages/bpost_shipping.pot (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bpost-shipping/trunk/bpost-shipping.php
r3025080 r3029601 6 6 * Author: bpost 7 7 * Author URI: https://www.bpost.be/ 8 * Version: 3.0. 48 * Version: 3.0.5 9 9 * WC requires at least: 3.0 10 10 * WC tested up to: 8.9 … … 15 15 define( 'BPOST_PLUGIN_DIR', __DIR__ ); 16 16 define( 'BPOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 17 define( 'BPOST_PLUGIN_VERSION', '3.0. 4' );17 define( 'BPOST_PLUGIN_VERSION', '3.0.5' ); 18 18 19 19 /** … … 167 167 add_action( 168 168 'woocommerce_after_shipping_rate', 169 array( $bpost_shipping_hooks, 'woocommerce_after_shipping_rate_add_shipping_options' ) 169 array( $bpost_shipping_hooks, 'woocommerce_after_shipping_rate_add_shipping_options' ), 170 10, 171 2 170 172 ); -
bpost-shipping/trunk/classes/class-wc-bpost-shipping-hooks.php
r2991689 r3029601 428 428 } 429 429 430 /** 431 * @param array $posted 432 * 433 * @return bool 434 */ 435 private function is_bpost_shipping_from_post( array $posted ) { 436 return 437 array_key_exists( 'shipping_method', $posted ) 438 && is_array( $posted['shipping_method'] ) 439 && ( 440 in_array( BPOST_PLUGIN_ID, $posted['shipping_method'], true ) 441 || in_array( BPOST_PLUGIN_ID . '_error', $posted['shipping_method'], true ) 442 ); 430 private function must_the_button_is_displayed( string $chosen_shipping_method ): bool { 431 switch ( $chosen_shipping_method ) { 432 case BPOST_PLUGIN_ID: 433 case BPOST_PLUGIN_ID . '_error': 434 return true; 435 default: 436 return false; 437 } 443 438 } 444 439 … … 465 460 } 466 461 462 /** 463 * Does the cart need a shipping? -> Does teh cart 464 * false if the cart contains only virtual items, else true 465 */ 467 466 private function need_shipping(): bool { 468 467 $shipping_packages = WC()->cart->get_shipping_packages(); … … 477 476 ); 478 477 478 // Condition to avoid bug if there is no item or more than 1 item 479 479 if ( $shipping_packages_count !== 1 ) { 480 480 Container::get_logger()->notice( … … 674 674 } 675 675 676 public function woocommerce_after_shipping_rate_add_shipping_options( $method ) {676 public function woocommerce_after_shipping_rate_add_shipping_options( $method, $index ) { 677 677 /** @var WC_Shipping_Rate $method */ 678 678 if ( $method->get_method_id() !== BPOST_PLUGIN_ID ) { … … 684 684 } 685 685 686 if ( ! $this->is_bpost_shipping_from_post( $_POST ) ) { 686 $chosen_shipping_methods = WC()->session->chosen_shipping_methods; 687 $chosen_shipping_method = isset( $chosen_shipping_methods[ $index ] ) ? $chosen_shipping_methods[ $index ] : ''; 688 689 if ( ! $this->must_the_button_is_displayed( $chosen_shipping_method ) ) { 687 690 return; 688 691 } -
bpost-shipping/trunk/composer.json
r3025080 r3029601 3 3 "description": "WooCommerce plugin for bpost shipping", 4 4 "type": "wordpress-plugin", 5 "version": "3.0. 4",5 "version": "3.0.5", 6 6 7 7 "require": { -
bpost-shipping/trunk/languages/bpost_shipping.pot
r3025080 r3029601 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: bpost shipping 3.0. 4\n"5 "Project-Id-Version: bpost shipping 3.0.5\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/package\n" 7 "POT-Creation-Date: 2024-01- 22 11:45:24+00:00\n"7 "POT-Creation-Date: 2024-01-31 16:01:49+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" … … 111 111 msgstr "" 112 112 113 #: classes/class-wc-bpost-shipping-hooks.php:69 3113 #: classes/class-wc-bpost-shipping-hooks.php:696 114 114 msgid "You have to specify a delivery method" 115 115 msgstr "" 116 116 117 #: classes/class-wc-bpost-shipping-hooks.php:69 5117 #: classes/class-wc-bpost-shipping-hooks.php:698 118 118 msgid "Your bpost delivery method" 119 119 msgstr "" 120 120 121 #: classes/class-wc-bpost-shipping-hooks.php:70 0121 #: classes/class-wc-bpost-shipping-hooks.php:703 122 122 msgid "bpost_method_Regular" 123 123 msgstr "" 124 124 125 #: classes/class-wc-bpost-shipping-hooks.php:70 1125 #: classes/class-wc-bpost-shipping-hooks.php:704 126 126 msgid "bpost_method_Pugo" 127 127 msgstr "" 128 128 129 #: classes/class-wc-bpost-shipping-hooks.php:70 2129 #: classes/class-wc-bpost-shipping-hooks.php:705 130 130 msgid "bpost_method_Parcels depot" 131 131 msgstr "" 132 132 133 #: classes/class-wc-bpost-shipping-hooks.php:70 3133 #: classes/class-wc-bpost-shipping-hooks.php:706 134 134 msgid "bpost_method_bpack BUSINESS" 135 135 msgstr "" 136 136 137 #: classes/class-wc-bpost-shipping-hooks.php:70 4137 #: classes/class-wc-bpost-shipping-hooks.php:707 138 138 msgid "bpost_method_Pugo international" 139 139 msgstr "" 140 140 141 #: classes/class-wc-bpost-shipping-hooks.php:71 3141 #: classes/class-wc-bpost-shipping-hooks.php:716 142 142 msgid "Change the delivery method" 143 143 msgstr "" 144 144 145 #: classes/class-wc-bpost-shipping-hooks.php:7 39145 #: classes/class-wc-bpost-shipping-hooks.php:742 146 146 msgid "Please, specify a bpost delivery method!" 147 147 msgstr "" … … 197 197 msgstr "" 198 198 199 #. #-#-#-#-# bpost_shipping.pot (bpost shipping 3.0. 4) #-#-#-#-#199 #. #-#-#-#-# bpost_shipping.pot (bpost shipping 3.0.5) #-#-#-#-# 200 200 #. Author of the plugin/theme 201 201 #: classes/class-wc-bpost-shipping-method.php:264 -
bpost-shipping/trunk/readme.txt
r3025080 r3029601 8 8 Tested up to: 6.4 9 9 Requires PHP: 7.4 10 Stable tag: 3.0. 410 Stable tag: 3.0.5 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 120 120 5. Configure your bpost shipping settings under the Woocommerce shipping > bpost shipping tab 121 121 == Changelog == 122 123 #### 3.0.5 124 125 *Release date: 2024-01-31* 126 127 * The popup button was not displayed in some cases 122 128 123 129 #### 3.0.4
Note: See TracChangeset
for help on using the changeset viewer.