My problem is the page couldn’t get the query again and reset the filter when I click the button on Main Menu (those code are on Site section) . It there any syntax to refresh current page?
My Site Code:
export function button38_click(event, $w) {
wixLocation.to(`/product-rings?ptype=18K`);
}
export function button39_click(event, $w) {
wixLocation.to(`/product-rings?ptype=PT950`);
}
export function button69_click(event, $w) {
wixLocation.to(`/product-rings?ptype=Feeri`);
}
My Page Code:
$w.onReady(function () {
//TODO: write your page related code here...
console.log("Getting ptype....");
let Product = wixLocation.query;
if(Product.ptype === "18K"){
$w('#SubType1').disable();
$w("#dataset1").setFilter(SubType1)
console.log(Product.ptype);
} else if(Product.ptype === "PT950"){
$w('#SubType2').disable();
$w("#dataset1").setFilter(SubType2)
console.log(Product.ptype);
} else if(Product.ptype === "Feeri") {
$w('#SubType3').disable();
$w("#dataset1").setFilter(SubType3)
} else {
$w("#dataset1").setFilter(SubType1.or(SubType2).or(SubType3))
console.log(Product.ptype);
}
});