feat(dashboard): shipping option tax rate overrides UI (#13260)
* feat(dashboard): shipping option tax rate overrides UI * feat: add location filter * feat: show service zone in SO table * feat: display location in the SO table
This commit is contained in:
@@ -17,3 +17,46 @@ export function isOptionEnabledInStore(
|
||||
r.operator === "eq"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a name for the shipping option location or generate one based on the locations address
|
||||
*/
|
||||
export function getFormattedShippingOptionLocationName(
|
||||
shippingOption: HttpTypes.AdminShippingOption
|
||||
) {
|
||||
const location = shippingOption.service_zone.fulfillment_set.location
|
||||
|
||||
if (!location) {
|
||||
return "N/A"
|
||||
}
|
||||
|
||||
if (location.name) {
|
||||
return `${location.name}`
|
||||
}
|
||||
|
||||
let name = ""
|
||||
|
||||
if (location.address) {
|
||||
if (location.address.address_1) {
|
||||
name += `${location.address.address_1}`
|
||||
}
|
||||
|
||||
if (location.address.address_2) {
|
||||
name += `${location.address.address_2}`
|
||||
}
|
||||
|
||||
if (location.address.city) {
|
||||
name += `${location.address.city}`
|
||||
}
|
||||
|
||||
if (location.address.postal_code) {
|
||||
name += `${location.address.postal_code}`
|
||||
}
|
||||
|
||||
if (location.address.country_code) {
|
||||
name += `, ${location.address.country_code}`
|
||||
}
|
||||
}
|
||||
|
||||
return name || "N/A"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user