+
+
{{ component.front_section_lang[0].data.subtotal }}
+
€5,043.18
+
+
+
{{ component.front_section_lang[0].data.shipping_cost }}
+
€5,043.18
+
+
+
{{ component.front_section_lang[0].data.total }}
+
+ €5,043.18
+
+
+
diff --git a/components/section/Product.vue b/components/section/Product.vue
index 4c4845f..ecd2b79 100644
--- a/components/section/Product.vue
+++ b/components/section/Product.vue
@@ -64,4 +64,11 @@ const props = defineProps({
const productStore = useProductStore()
const menuStore = useMenuStore()
+
+const isError = ref(false);
+
+function handleImageError(event: Event) {
+ isError.value = true;
+ (event.target as HTMLImageElement).src = '/photo.svg';
+}
diff --git a/public/photo.svg b/public/photo.svg
index c1b7162..03e867c 100644
--- a/public/photo.svg
+++ b/public/photo.svg
@@ -1,3 +1,3 @@
diff --git a/stores/checkoutStore.ts b/stores/checkoutStore.ts
index 3d9b17d..f1485c4 100644
--- a/stores/checkoutStore.ts
+++ b/stores/checkoutStore.ts
@@ -1,14 +1,25 @@
-import { validation } from '../utils/validation'
-import { REGEX_PHONE } from '../utils/regex'
-import type { GenericResponse, GenericResponseItems, UserCart } from '~/types'
-import type { AddressesList, UserAddressOfficial } from '~/types/checkout'
-import type { CartProduct } from '~/types/product'
+import type { GenericResponse, GenericResponseItems, UserCart } from "~/types";
+import type {
+ Address,
+ AddressesList,
+ CheckoutOrder,
+ Payment,
+ UserAddressOfficial,
+} from "~/types/checkout";
+import { validation } from "../utils/validation";
+import { REGEX_PHONE } from "../utils/regex";
+import type { CartProduct } from "~/types/product";
-export const useCheckoutStore = defineStore('checkoutStore', () => {
- const { $toast } = useNuxtApp()
- const menuStore = useMenuStore()
- const selectedIso = ref(menuStore.selectedCountry)
- const showSummary = ref(false)
+export const useCheckoutStore = defineStore("checkoutStore", () => {
+ const { $toast } = useNuxtApp();
+ const menuStore = useMenuStore();
+ const selectedIso = ref(menuStore.selectedCountry);
+
+ const vLegal = ref(false);
+ const vTerms = ref(false);
+ const vNote = ref("");
+ const legalValidation = ref(false);
+ const termsValidation = ref(false);
// get address list
const addressesList = ref
()
@@ -141,8 +152,8 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
}
const phoneValidation = ref(null)
- const userStore = useUserStore()
- // send form
+ // send checkout form
+ const userStore = useUserStore();
async function sendForm() {
const phoneNum = vUseAccountPhoneNumber.value
? accountPhoneNumber.value
@@ -189,12 +200,12 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
$toast.success('Form successfully sent', {
autoClose: 5000,
dangerouslyHTMLString: true,
- })
- // redirectToSummary();
- showSummary.value = true
- }
- else {
- $toast.error('Failed to send form. Please try again.', {
+ });
+ menuStore.navigateToItem(
+ menuStore.menuItems?.find((item) => item.id === 13)
+ );
+ } else {
+ $toast.error("Failed to send form. Please try again.", {
autoClose: 5000,
dangerouslyHTMLString: true,
})
@@ -209,6 +220,7 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
activeAddress.value = item
}
+ // get checkout
async function getCheckout() {
try {
await useMyFetch>(
@@ -269,19 +281,20 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
const shippingPrice = ref()
async function getDeliveryOptions() {
try {
- const { data } = await useMyFetch<
- GenericResponseItems<{
- items: [
- {
- country_iso: string
- country_name: string
- delivery_supplier_id: number
- delivery_supplier_name: string
- id: number
- shippment_price: string
- },
- ]
- }>
+ const res = await useMyFetch<
+ GenericResponseItems