From dc6a9ed283ba4bc01fb9815d79660e33c7f9f10b Mon Sep 17 00:00:00 2001 From: padreug Date: Fri, 5 Sep 2025 03:36:36 +0200 Subject: [PATCH] Add new routes for shopping cart and checkout pages in market module - Introduce routes for the Shopping Cart and Checkout pages, enhancing user navigation within the market module. - Implement a redirect for the Market Dashboard to improve user flow. - Add an alias for clearCheckout for consistency in the market store functions. --- src/modules/market/index.ts | 22 ++ src/modules/market/stores/market.ts | 1 + src/modules/market/views/CartPage.vue | 9 + src/modules/market/views/CheckoutPage.vue | 397 ++++++++++++++++++++++ 4 files changed, 429 insertions(+) create mode 100644 src/modules/market/views/CartPage.vue create mode 100644 src/modules/market/views/CheckoutPage.vue diff --git a/src/modules/market/index.ts b/src/modules/market/index.ts index 5ca8d28..adb4962 100644 --- a/src/modules/market/index.ts +++ b/src/modules/market/index.ts @@ -90,6 +90,28 @@ export const marketModule: ModulePlugin = { title: 'Market Dashboard', requiresAuth: true } + }, + { + path: '/market-dashboard', + redirect: '/market/dashboard' + }, + { + path: '/cart', + name: 'cart', + component: () => import('./views/CartPage.vue'), + meta: { + title: 'Shopping Cart', + requiresAuth: false + } + }, + { + path: '/checkout/:stallId', + name: 'checkout', + component: () => import('./views/CheckoutPage.vue'), + meta: { + title: 'Checkout', + requiresAuth: false + } } ] as RouteRecordRaw[], diff --git a/src/modules/market/stores/market.ts b/src/modules/market/stores/market.ts index ee57713..e9cbdaf 100644 --- a/src/modules/market/stores/market.ts +++ b/src/modules/market/stores/market.ts @@ -860,6 +860,7 @@ export const useMarketStore = defineStore('market', () => { clearAllStallCarts, setCheckoutCart, clearCheckout, + clearCheckoutCart: clearCheckout, // Alias for consistency setShippingZone, createOrder, updateOrderStatus, diff --git a/src/modules/market/views/CartPage.vue b/src/modules/market/views/CartPage.vue new file mode 100644 index 0000000..d303ab1 --- /dev/null +++ b/src/modules/market/views/CartPage.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/src/modules/market/views/CheckoutPage.vue b/src/modules/market/views/CheckoutPage.vue new file mode 100644 index 0000000..0453f36 --- /dev/null +++ b/src/modules/market/views/CheckoutPage.vue @@ -0,0 +1,397 @@ +