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