calculator and other cleaning
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user