Hello everyone.
I get big problem with redirect.
Now i have some products with redirect to another pages.
After user redirected he can’t use browser button (important this button) back because after click back he going to product page which redirect again - like infinity loop.
How I can change link for this button or how I can make some another redirect for products?
ID - its ID of product.
try to click back for understanding what I mean (sorry for my poor english)
Its very big problem and i very need to solve this, please…)
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#productPage1').getProduct()
.then( (product) => {
if(product._id === '18837fe4-787c-46bb-8c1d-9dcf0b322294') {
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/carbon');
}
else if (product._id === '4663b6cd-0297-4125-8d4f-dcf61d73b467') {
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/label');
}
else if (product._id === 'b696e3e2-5a90-d84e-7ebb-d51b7b47ae46') { //geilik4x4 store (main page)
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/gelik4x4');
}
else if (product._id === 'd7a7eb5d-3a60-263f-b2bb-850f125d2c99') { //geilik6x6 store (main page)
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/gelik6x6');
}
else if (product._id === 'fa563ab3-607a-9eef-fa89-ea2743e37879') { //carbon store (main page)
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/carbon');
}
else if (product._id === 'a44fa427-cdfd-331f-6f8a-f27d033bd4a7') { //label store (main page)
$w('#productPage1').hide()
$w('#group1').hide()
wixLocation.to('/label');
}
else{
console.log('product')
}
})
});