calculator and other cleaning

This commit is contained in:
2025-07-04 22:39:51 +02:00
parent a2db817133
commit 0bab1d83a1
19 changed files with 420 additions and 93 deletions

View File

@ -21,6 +21,7 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
const vNote = ref('')
const legalValidation = ref(false)
const termsValidation = ref(false)
const totalNumberOfProducts = ref(0)
// get address list
const addressesList = ref<AddressesList[]>()
@ -265,6 +266,13 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
},
)
totalNumberOfProducts.value = 0
if (data.cart_items && Array.isArray(data.cart_items)) {
for (const item of data.cart_items) {
totalNumberOfProducts.value = totalNumberOfProducts.value + item.quantity
}
}
products.value = data.cart_items
fullPrice.value = data.total_value
fullProductsPrice.value = data.total_value
@ -551,6 +559,7 @@ export const useCheckoutStore = defineStore('checkoutStore', () => {
paymentMethods,
currentPayment,
fullAddress,
totalNumberOfProducts,
vLegal,
vTerms,