Local Pickup: Change location modal to have store country as default country

This commit is contained in:
Nadir Seghir 2022-12-23 13:26:06 +01:00
parent 994491c2b8
commit 549358c65c
4 changed files with 5 additions and 1 deletions

View File

@ -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 } ) => {

View File

@ -31,6 +31,7 @@ export type ShippingMethodSettings = {
};
export type ReadOnlySettings = {
storeCountry: string;
hasLegacyPickup: boolean;
};

View File

@ -32,6 +32,7 @@ export const defaultSettings = {
export const defaultReadyOnlySettings = {
hasLegacyPickup: false,
storeCountry: '',
};
declare global {
const hydratedScreenSettings: {

View File

@ -195,6 +195,7 @@ class ShippingController {
'pickupLocations' => $formatted_pickup_locations,
'readonlySettings' => array(
'hasLegacyPickup' => $has_legacy_pickup,
'storeCountry' => WC()->countries->get_base_country(),
),
);