Is it Bug? Navigation on and from Product Page

Hi Wix Team
Need help with 2 issues

  1. On dynamic page (ex /Storage/prs0000019) I have gallery connected to Dataset (Link->ProductPageUrl). Standard Product Page (classic) is opening . Now I want to come back from Product Page to gallery page.
    Trying to add button and code on Product Page:

import wixWindow from 'wix-window';
import wixLocation from 'wix-location';

$w.onReady(function () {
});

export function button9_click(event, $w) {
 let prevPage=wixWindow.referrer;
 let locale=prevPage.replace(wixLocation.baseUrl,'/')
 wixLocation.to(locale);
}

Nothing. Simple wixLocation.to( “/Storage/prs0000019”) does work. Test was done on updated published site

  1. Standard Prev/Next buttons on Product Pages used to disappear. It means sometimes it’s there, sometimes not. Can’t identify the reasons

What do you get in the console if you use console.log(prevPage); and also console.log(locale); What is the value of those strings?

console.log(prevPage, wixLocation.baseUrl, locale);


This is from preview mode (Safari) It is not supposed to work in preview

And this is from published (Chrome JS console)

Hey Wix Team
Please your help

Hi,
Why do you use the replace function?
I think that you should simply use the wixLocation.to() function without using the replace function:

export function button9_click(event, $w) { 
   let prevPage=wixWindow.referrer; 
   let wixLocation.to(prevPage); 
} 

Good luck,
Tal

Hi, Tal
I’ll try but…

Examples

Navigate to a local link
/localPageURL — another page on your site

when

let referrer = wixWindow.referrer; // “http://somesite.com

Gmar Hatima Tova

Doesn’t work for me
null is for referrer