diff --git a/bo/src/components/customer/Cart1.vue b/bo/src/components/customer/Cart1.vue
new file mode 100644
index 0000000..fc6d392
--- /dev/null
+++ b/bo/src/components/customer/Cart1.vue
@@ -0,0 +1,66 @@
+
+
+
+
+ {{ t('Cart Items') }}
+
+
+
+
+
+
+
![]()
+
+
+
+
{{ item.name }}
+
+ {{ t('Qty') }}: {{ item.quantity }} × ${{ item.price.toFixed(2) }}
+
+
+
+
+
${{ (item.price * item.quantity).toFixed(2) }}
+
+
+
+
+
+
+
{{ t('Your cart is empty') }}
+
+
+
+ {{ t('Continue to Checkout') }}
+
+
+ {{ t('Cancel') }}
+
+
+
+
+
+
+
diff --git a/bo/src/components/customer/PageAddresses.vue b/bo/src/components/customer/PageAddresses.vue
index e2d85f5..36bc3ae 100644
--- a/bo/src/components/customer/PageAddresses.vue
+++ b/bo/src/components/customer/PageAddresses.vue
@@ -1,5 +1,5 @@
-
+
{{ t('Addresses') }}
diff --git a/bo/src/components/customer/PageCart.vue b/bo/src/components/customer/PageCart.vue
index 4b37d99..2919c97 100644
--- a/bo/src/components/customer/PageCart.vue
+++ b/bo/src/components/customer/PageCart.vue
@@ -1,5 +1,5 @@
-
+
{{ t('Shopping Cart') }}
diff --git a/bo/src/components/customer/PageProductCardFull.vue b/bo/src/components/customer/PageProductCardFull.vue
index e10e69d..810098f 100644
--- a/bo/src/components/customer/PageProductCardFull.vue
+++ b/bo/src/components/customer/PageProductCardFull.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/bo/src/components/customer/PageProductsList.vue b/bo/src/components/customer/PageProductsList.vue
index 6cc47f9..2068f38 100644
--- a/bo/src/components/customer/PageProductsList.vue
+++ b/bo/src/components/customer/PageProductsList.vue
@@ -1,5 +1,5 @@
-
+
Products
Loading products...
@@ -13,35 +13,36 @@
|
- Product ID
- |
+ Image
- Reference
- |
+ Product ID
- Price
- |
+ Name
+
+ Link |
-
- |
- {{ product.product_id }}
+ |
+
|
-
- {{ product.reference }}
+ | {{
+ product.product_id }} |
+ {{ product.name }}
|
-
- {{ product.price.toFixed(2) }}
+ |
+ {{ product.LinkRewrite }}
|
-
-
@@ -54,36 +55,36 @@ import { useFetchJson } from '@/composable/useFetchJson'
interface Product {
product_id: number
- reference: string
- price: number
+ name: string
+ ImageID: number
+ LinkRewrite: string
}
interface ApiResponse {
+ message: string
items: Product[]
count: number
- message: string
}
-const products = ref
([])
+const productsList = ref([])
const loading = ref(true)
const error = ref(null)
-async function fetchProducts() {
+function getImageUrl(imageID: number, linkRewrite: string, size: string = 'small_default') {
+ return `https://www.naluconcept.com/${imageID}-${size}/${linkRewrite}.webp`
+}
+async function fetchProductList() {
loading.value = true
error.value = null
-
try {
- const response = await useFetchJson('/api/v1/restricted/list-products/get-listing?p=3&elems') as unknown as { items: Product[] }
- products.value = response.items || []
- } catch (e: any) {
- error.value = e.message || 'Failed to load products'
- console.error('Error fetching products:', e)
+ const response = await useFetchJson('/api/v1/restricted/list-products/get-listing?p&elems&shopID=1') as ApiResponse
+ productsList.value = response.items || []
+ } catch (e: unknown) {
+ error.value = e instanceof Error ? e.message : 'Failed to load products'
+ console.error(e)
} finally {
loading.value = false
}
}
-
-onMounted(() => {
- fetchProducts()
-})
-
+onMounted(fetchProductList)
+
\ No newline at end of file
diff --git a/bo/src/router/index.ts b/bo/src/router/index.ts
index 5860b69..44fedb9 100644
--- a/bo/src/router/index.ts
+++ b/bo/src/router/index.ts
@@ -30,6 +30,7 @@ const router = createRouter({
{ path: 'product-card-full/', component: () => import('../components/customer/PageProductCardFull.vue'), name: 'product-card-full' },
{ path: 'addresses', component: () => import('../components/customer/PageAddresses.vue'), name: 'addresses' },
{ path: 'cart', component: () => import('../components/customer/PageCart.vue'), name: 'cart' },
+ { path: 'cart1', component: () => import('../components/customer/Cart1.vue'), name: 'cart1' },
{ path: 'products-list', component: () => import('../components/customer/PageProductsList.vue'), name: 'products-list' },
],
},
diff --git a/bo/src/stores/cart.ts b/bo/src/stores/cart.ts
index e9fcff5..c2f364b 100644
--- a/bo/src/stores/cart.ts
+++ b/bo/src/stores/cart.ts
@@ -65,6 +65,7 @@ export const useCartStore = defineStore('cart', () => {
}
}
+
function removeItem(itemId: number) {
const index = items.value.findIndex(i => i.id === itemId)
if (index !== -1) {
diff --git a/bo/src/stores/product.ts b/bo/src/stores/product.ts
index de09a7a..801ff0c 100644
--- a/bo/src/stores/product.ts
+++ b/bo/src/stores/product.ts
@@ -42,7 +42,7 @@ export const useProductStore = defineStore('product', () => {
}
}
- async function saveProductDescription() {
+ async function saveProductDescription() {
try {
const data = await useFetchJson(
`/api/v1/restricted/product-description/save-product-description?productID=1&productShopID=1&productLangID=1`,
@@ -92,6 +92,6 @@ export const useProductStore = defineStore('product', () => {
getProductDescription,
clearCurrentProduct,
saveProductDescription,
- translateProductDescription
+ translateProductDescription,
}
})