diff --git a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx index 7e22dc517b3..0eaaeaa85bf 100644 --- a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx +++ b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/location-settings.tsx @@ -48,6 +48,7 @@ const LocationSettings = () => { setPickupLocations, toggleLocation, updateLocation, + readOnlySettings, } = useSettingsContext(); const [ editingLocation, setEditingLocation ] = useState< UniqueIdentifier >( '' ); @@ -138,7 +139,7 @@ const LocationSettings = () => { city: '', state: '', postcode: '', - country: '', + country: readOnlySettings.storeCountry, }, } : pickupLocations.find( ( { id } ) => { diff --git a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/types.ts b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/types.ts index 86184fbcb41..57741f3b69b 100644 --- a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/types.ts +++ b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/types.ts @@ -31,6 +31,7 @@ export type ShippingMethodSettings = { }; export type ReadOnlySettings = { + storeCountry: string; hasLegacyPickup: boolean; }; diff --git a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts index cb7ec5f1b31..ac3271baf13 100644 --- a/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts +++ b/plugins/woocommerce-blocks/assets/js/extensions/shipping-methods/pickup-location/utils.ts @@ -32,6 +32,7 @@ export const defaultSettings = { export const defaultReadyOnlySettings = { hasLegacyPickup: false, + storeCountry: '', }; declare global { const hydratedScreenSettings: { diff --git a/plugins/woocommerce-blocks/src/Shipping/ShippingController.php b/plugins/woocommerce-blocks/src/Shipping/ShippingController.php index 12c5e8bb34c..4c7b1b34be7 100644 --- a/plugins/woocommerce-blocks/src/Shipping/ShippingController.php +++ b/plugins/woocommerce-blocks/src/Shipping/ShippingController.php @@ -195,6 +195,7 @@ class ShippingController { 'pickupLocations' => $formatted_pickup_locations, 'readonlySettings' => array( 'hasLegacyPickup' => $has_legacy_pickup, + 'storeCountry' => WC()->countries->get_base_country(), ), );