File tree Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ Contributors: goran87
3
3
Tags: gls, shipping, woocommerce shipping
4
4
Requires at least: 4.4
5
5
Tested up to: 6.7
6
- Stable tag: 1.2.3
6
+ Stable tag: 1.2.4
7
7
License: GPLv2
8
8
License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
9
@@ -63,6 +63,9 @@ To install and configure this plugin:
63
63
64
64
== Changelog ==
65
65
66
+ = 1.2.4 =
67
+ * Fixed issue when changing shipping method would leave pickup info
68
+
66
69
= 1.2.3 =
67
70
* Added WebshopEngine in request logs.
68
71
Original file line number Diff line number Diff line change 77
77
}
78
78
} ) ;
79
79
80
+ function clearGLSPickupInfo ( ) {
81
+ var glsPickupInfo = document . getElementById ( "gls-pickup-info" ) ;
82
+ var glsPickupInfoData = document . getElementById (
83
+ "gls-pickup-info-data"
84
+ ) ;
85
+
86
+ if ( glsPickupInfo ) {
87
+ glsPickupInfo . innerHTML = "" ;
88
+ glsPickupInfo . style . display = "none" ;
89
+ }
90
+ if ( glsPickupInfoData ) {
91
+ glsPickupInfoData . value = "" ;
92
+ }
93
+ }
94
+
80
95
function updateCheckout ( ) {
81
96
var selectedShippingMethod = document . querySelector (
82
97
'input[name="shipping_method[0]"]:checked'
83
98
) ;
84
99
var glsMap = document . getElementById ( "gls-map" ) ;
85
- var glsPickupInfo = document . getElementById ( "gls-pickup-info" ) ;
100
+
101
+ clearGLSPickupInfo ( ) ;
86
102
87
103
if ( selectedShippingMethod ) {
88
104
switch ( selectedShippingMethod . value ) {
92
108
case "gls_shipping_method_parcel_shop" :
93
109
glsMap . setAttribute ( "filter-type" , "parcel-shop" ) ;
94
110
break ;
95
- default :
96
- if ( glsPickupInfo ) {
97
- glsPickupInfo . style . display = "none" ;
98
- }
99
- break ;
100
111
}
101
112
}
102
113
}
103
114
115
+ // Event listener for shipping method change
116
+ document . body . addEventListener ( "change" , function ( event ) {
117
+ if ( event . target . name === "shipping_method[0]" ) {
118
+ updateCheckout ( ) ;
119
+ }
120
+ } ) ;
121
+
104
122
document . body . addEventListener ( "updated_checkout" , updateCheckout ) ;
105
123
} ) ;
106
124
} ) ( ) ;
Original file line number Diff line number Diff line change 3
3
/**
4
4
* Plugin Name: GLS Shipping for WooCommerce
5
5
* Description: Offical GLS Shipping for WooCommerce plugin
6
- * Version: 1.2.3
6
+ * Version: 1.2.4
7
7
* Author: Inchoo
8
8
* License: GPLv2
9
9
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -24,7 +24,7 @@ final class GLS_Shipping_For_Woo
24
24
{
25
25
private static $ instance ;
26
26
27
- private $ version = '1.2.3 ' ;
27
+ private $ version = '1.2.4 ' ;
28
28
29
29
private function __construct ()
30
30
{
You can’t perform that action at this time.
0 commit comments