Bug in tproducts

This commit is contained in:
2024-01-20 22:40:38 +01:00
parent 8e3cdf8b17
commit 5c3e2b89b8

View File

@@ -56,7 +56,8 @@ const gchartEvents = ref({
const tproducts = computed(() => {
console.log('PR=', products);
console.log('CC=', countryCurrency.value);
return products.value.map((prod) => {
return products.value.map((p) => {
const prod = { ...p };
prod.currency = countryCurrency.value[prod.countryName];
if (currencyHash.value[prod.currency]) prod.calcPrice = prod.salesPrice / currencyHash.value[prod.currency];
else {
@@ -245,8 +246,8 @@ const fetch_rates = async () => {
const fetch_ccodes = async () => {
try {
// const response2 = await axios.get(route('geo.ip.get'));
// geoip.value = response2.data;
const response2 = await axios.get(route('geo.ip.get'));
geoip.value = response2.data;
const response = await axios.get(route('ccountry.codes'))
ccodes.value = response.data;
@@ -354,12 +355,12 @@ const submit = () => {
form.post(route('products.compare'));
};
// watch(ccodes, (codes) => {
// console.log('NNN=',codes);
// console.log('IP=',geoip.value);
// codes.forEach((c) => { if (c.code == geoip.value.iso_code) form.country = c; });
// console.log(form.country);
// })
watch(ccodes, (codes) => {
console.log('NNN=',codes);
console.log('IP=',geoip.value);
codes.forEach((c) => { if (c.code == geoip.value.iso_code) form.country = c; });
console.log(form.country);
})
</script>
<template>
<GuestLayout>