| @@ -213,21 +213,11 @@ | ||
| 213 | 213 | * |
| 214 | 214 | * @return array |
| 215 | 215 | */ |
| 216 | 216 | public function get_localize_data() { |
| 217 | - $needs_shipping = ''; | |
| 218 | - | |
| 219 | - if ( function_exists( 'WC' ) ) { | |
| 220 | - $cart = WC()->cart; | |
| 221 | - | |
| 222 | - if ( $cart && method_exists( $cart, 'needs_shipping' ) ) { | |
| 223 | - $needs_shipping = $cart->needs_shipping(); | |
| 224 | - } | |
| 225 | - } | |
| 226 | - | |
| 227 | 217 | return [ |
| 228 | 218 | 'nonce' => wp_create_nonce( 'sellkit_elementor' ), |
| 229 | - 'wcNeedShipping' => $needs_shipping, | |
| 219 | + 'wcNeedShipping' => ( function_exists( 'WC' ) ) ? WC()->cart->needs_shipping() : '', | |
| 230 | 220 | 'url' => [ |
| 231 | 221 | 'assets' => sellkit()->plugin_url() . 'assets/', |
| 232 | 222 | ], |
| 233 | 223 | ]; |