This repository was archived by the owner on Feb 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-28
lines changed
Expand file tree Collapse file tree 2 files changed +33
-28
lines changed Original file line number Diff line number Diff line change @@ -155,21 +155,23 @@ protected function render( $attributes, $content ) {
155155 */
156156 protected function enqueue_data ( array $ attributes = [] ) {
157157 parent ::enqueue_data ( $ attributes );
158+ if ( wc_shipping_enabled () ) {
159+ $ this ->asset_data_registry ->add (
160+ 'shippingCountries ' ,
161+ function () {
162+ return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_countries () );
163+ },
164+ true
165+ );
166+ $ this ->asset_data_registry ->add (
167+ 'shippingStates ' ,
168+ function () {
169+ return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_country_states () );
170+ },
171+ true
172+ );
173+ }
158174
159- $ this ->asset_data_registry ->add (
160- 'shippingCountries ' ,
161- function () {
162- return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_countries () );
163- },
164- true
165- );
166- $ this ->asset_data_registry ->add (
167- 'shippingStates ' ,
168- function () {
169- return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_country_states () );
170- },
171- true
172- );
173175 $ this ->asset_data_registry ->add (
174176 'countryLocale ' ,
175177 function () {
Original file line number Diff line number Diff line change @@ -181,20 +181,23 @@ function() {
181181 },
182182 true
183183 );
184- $ this ->asset_data_registry ->add (
185- 'shippingCountries ' ,
186- function () {
187- return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_countries () );
188- },
189- true
190- );
191- $ this ->asset_data_registry ->add (
192- 'shippingStates ' ,
193- function () {
194- return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_country_states () );
195- },
196- true
197- );
184+ if ( wc_shipping_enabled () ) {
185+ $ this ->asset_data_registry ->add (
186+ 'shippingCountries ' ,
187+ function () {
188+ return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_countries () );
189+ },
190+ true
191+ );
192+ $ this ->asset_data_registry ->add (
193+ 'shippingStates ' ,
194+ function () {
195+ return $ this ->deep_sort_with_accents ( WC ()->countries ->get_shipping_country_states () );
196+ },
197+ true
198+ );
199+ }
200+
198201 $ this ->asset_data_registry ->add (
199202 'countryLocale ' ,
200203 function () {
You can’t perform that action at this time.
0 commit comments