ItellaPlugins / itella-shipping-woocommerce

Itella Shipping Plugin for Woocommerce
GNU General Public License v2.0
4 stars 3 forks source link

Reading locations file #43

Closed alekln closed 2 years ago

alekln commented 2 years ago

your code

`public function get_pickup_points($shipping_country_id) { $pickup_points = wp_remote_get(plugin_dir_url(FILE) . '../locations/locations' . $shipping_country_id . '.json');

return json_decode($pickup_points['body']);

} `

my suggestion

`public function get_pickup_points($shipping_country_id) {

$pickup_points = file_get_contents(plugin_dir_path(__FILE__) . '../locations/locations' . $shipping_country_id . '.json');

return json_decode($pickup_points);

}`

either it doesnt work on localhost

markakk commented 2 years ago

Issue fixed in #50