Skip to content

Commit

Permalink
Prevent resetting shipping providers after additional load call.
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisnissle committed Mar 21, 2024
1 parent 4c3f65f commit 433d5ff
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ShippingProvider/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ public function load_shipping_providers() {
return array();
}

$this->shipping_providers = array();

$shipping_providers = WC_Data_Store::load( 'shipping-provider' )->get_shipping_providers();
$registered_providers = $this->get_shipping_provider_class_names();

Expand All @@ -181,10 +179,8 @@ public function load_shipping_providers() {
// For the settings in the backend, and for non-shipping zone methods, we still need to load any registered classes here.
foreach ( $shipping_providers as $provider_name => $provider_class ) {
if ( $cache = \Vendidero\Germanized\Shipments\Caches\Helper::get_cache_object( 'shipping-providers' ) ) {
$provider = $cache->get( $provider_name );

if ( ! is_null( $provider ) ) {
return $provider;
if ( $cache->get( $provider_name ) ) {
continue;
}
}

Expand Down

0 comments on commit 433d5ff

Please sign in to comment.