From 143c8afcc3d5edcf0ea8a93b9fd7e3b6ded96a1a Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 5 Sep 2025 03:45:40 +0200 Subject: [PATCH] Enhance shipping zone functionality in CheckoutPage and market types - Add 'shipping_zones' property to the Stall interface to support LNbits format. - Update ShippingZone interface to include optional 'countries' property for better zone coverage representation. - Modify CheckoutPage.vue to display shipping zone details, including a message for zones that do not require physical shipping. - Improve user feedback by updating messages related to shipping address requirements based on selected shipping zone. - Refactor logic to auto-select shipping zones and handle cases where no shipping zones are available, enhancing user experience during checkout. --- src/modules/market/types/market.ts | 2 + src/modules/market/views/CheckoutPage.vue | 93 ++++++++++++++++++----- 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/src/modules/market/types/market.ts b/src/modules/market/types/market.ts index d8dfd79..5c21145 100644 --- a/src/modules/market/types/market.ts +++ b/src/modules/market/types/market.ts @@ -21,6 +21,7 @@ export interface Stall { logo?: string categories?: string[] shipping?: ShippingZone[] + shipping_zones?: ShippingZone[] // LNbits format currency: string nostrEventId?: string } @@ -94,6 +95,7 @@ export interface ShippingZone { name: string cost: number currency: string + countries?: string[] // Countries/regions this zone covers description?: string estimatedDays?: string requiresPhysicalShipping?: boolean diff --git a/src/modules/market/views/CheckoutPage.vue b/src/modules/market/views/CheckoutPage.vue index 0453f36..1a1b6f4 100644 --- a/src/modules/market/views/CheckoutPage.vue +++ b/src/modules/market/views/CheckoutPage.vue @@ -110,7 +110,15 @@

{{ zone.name }}

-

{{ zone.countries?.join(', ') || 'Available' }}

+

+ {{ zone.countries?.join(', ') || 'Available' }} + + • No shipping required + +

+

+ {{ zone.description }} +

@@ -123,14 +131,15 @@

-

No shipping zones available

+

This merchant hasn't configured shipping zones yet.

+

Please contact the merchant for shipping information.

- +