Local Pickup: Change location modal to have store country as default country
This commit is contained in:
parent
994491c2b8
commit
549358c65c
|
@ -48,6 +48,7 @@ const LocationSettings = () => {
|
||||||
setPickupLocations,
|
setPickupLocations,
|
||||||
toggleLocation,
|
toggleLocation,
|
||||||
updateLocation,
|
updateLocation,
|
||||||
|
readOnlySettings,
|
||||||
} = useSettingsContext();
|
} = useSettingsContext();
|
||||||
const [ editingLocation, setEditingLocation ] =
|
const [ editingLocation, setEditingLocation ] =
|
||||||
useState< UniqueIdentifier >( '' );
|
useState< UniqueIdentifier >( '' );
|
||||||
|
@ -138,7 +139,7 @@ const LocationSettings = () => {
|
||||||
city: '',
|
city: '',
|
||||||
state: '',
|
state: '',
|
||||||
postcode: '',
|
postcode: '',
|
||||||
country: '',
|
country: readOnlySettings.storeCountry,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: pickupLocations.find( ( { id } ) => {
|
: pickupLocations.find( ( { id } ) => {
|
||||||
|
|
|
@ -31,6 +31,7 @@ export type ShippingMethodSettings = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ReadOnlySettings = {
|
export type ReadOnlySettings = {
|
||||||
|
storeCountry: string;
|
||||||
hasLegacyPickup: boolean;
|
hasLegacyPickup: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ export const defaultSettings = {
|
||||||
|
|
||||||
export const defaultReadyOnlySettings = {
|
export const defaultReadyOnlySettings = {
|
||||||
hasLegacyPickup: false,
|
hasLegacyPickup: false,
|
||||||
|
storeCountry: '',
|
||||||
};
|
};
|
||||||
declare global {
|
declare global {
|
||||||
const hydratedScreenSettings: {
|
const hydratedScreenSettings: {
|
||||||
|
|
|
@ -195,6 +195,7 @@ class ShippingController {
|
||||||
'pickupLocations' => $formatted_pickup_locations,
|
'pickupLocations' => $formatted_pickup_locations,
|
||||||
'readonlySettings' => array(
|
'readonlySettings' => array(
|
||||||
'hasLegacyPickup' => $has_legacy_pickup,
|
'hasLegacyPickup' => $has_legacy_pickup,
|
||||||
|
'storeCountry' => WC()->countries->get_base_country(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue