Hello Guys,
I have a Online Shopping Website where I am displaying products from a Database in a Repeater.
In the Database, I have 2 or more currencies for the same product
‘adultprice’ contains the price in MUR
‘adultEur’ contains the price in EUR
The rates are to be updated manually every week.
On the page I have a Dropdown as below
Now whenever someone selects EUR from the dropdown I want the price from the EUR column in the database displayed inside the repeater in text element $w(“#aprix”).text
Same for USD, MUR, GBP and so on
I tried this code below but to no avail
export function dropdown1_change(event, $w) {
getCurrency();
}
function getCurrency() {
let exid = $w("#iid").text;
wixData.query("SalesInventory")
.eq("title", exid)
.find()
.then((results) => {
let items = results.items;
items.forEach((item) => {
if ($w("#dropdown1").value === 'EUR') {
item.adultEur = $w("#aprix").text;
} else if ($w("#dropdown1").value === 'MUR') {
item.adultPrice = $w("#aprix").text;
} else {
item.adultPrice = $w("#aprix").text;
}
});
});
}
Does anyone have any suggestion ?
Thank you