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,
|
||||
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 } ) => {
|
||||
|
|
|
@ -31,6 +31,7 @@ export type ShippingMethodSettings = {
|
|||
};
|
||||
|
||||
export type ReadOnlySettings = {
|
||||
storeCountry: string;
|
||||
hasLegacyPickup: boolean;
|
||||
};
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ export const defaultSettings = {
|
|||
|
||||
export const defaultReadyOnlySettings = {
|
||||
hasLegacyPickup: false,
|
||||
storeCountry: '',
|
||||
};
|
||||
declare global {
|
||||
const hydratedScreenSettings: {
|
||||
|
|
|
@ -195,6 +195,7 @@ class ShippingController {
|
|||
'pickupLocations' => $formatted_pickup_locations,
|
||||
'readonlySettings' => array(
|
||||
'hasLegacyPickup' => $has_legacy_pickup,
|
||||
'storeCountry' => WC()->countries->get_base_country(),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue