I am having a problem with the store breadcrumbs not showing the correct collections, so the back path is not taking you back to collection you came from but a random other collection... I am waiting for WIX support to get back to me (sigh)... I have found that if I do a screen refresh then the correct breadcrumb path will then usually show. So, I'm wondering as a quick fix that if I can find a way for a store page to force a page refresh as soon as it loads it may help as a short term fix?
I'm not a coder, but could someone point me in the right direction of a piece of code I can paste into the product page so it will fore a refresh just the once after it loads?
Thanks.
Ciao,
volevamo sapere se c'era un codice per aggiornare la pagina solamente una volta dopo che la pagina è stata caricata?
import wixLocation from 'wix-location';
$w.onReady(function () {
setTimeout(() => wixLocation.to(wixLocation.url), 5000)//TIME IN MILLISECONDS
})
Questa funzione refresha la pagina ogni 5 secondi, a noi servirebbe una volta sola.
Grazie del supporto!
Yes this is possible, to do this you're going to have to store data in the session or local. Session basically means store in current tab (session) only. Local basically means store permanently on current browser (even if the user closes all the tabs/window and come back next time the data will remain there as long as the browser hasn't been reset/cleared)
Using session:
import {session} from 'wix-storage'; import wixLocation from 'wix-location'; $w.onReady(function () { let loaded = session.getItem("loaded") if (loaded === "true") { //nothing happens } else { session.setItem("loaded","true") wixLocation.to(wixLocation.url) } })
Using Local:
import {local} from 'wix-storage'; import wixLocation from 'wix-location'; $w.onReady(function () { let loaded = local.getItem("loaded") if (loaded === "true") { //nothing happens } else { local.setItem("loaded","true") wixLocation.to(wixLocation.url) } })
With session and local you can pass data to other tabs/pages. Very useful in some situations
DJ bon26
The last link gives you options to do it as you asked.
Either when the user logs in or by adding the wixlocation to() function to your pages onReady function.
https://support.wix.com/en/article/request-setting-a-page-to-refresh-automatically
https://www.wix.com/corvid/forum/community-discussion/page-auto-refresh
https://www.wix.com/corvid/forum/community-discussion/reload-page-after-button-click
https://www.wix.com/corvid/forum/community-discussion/how-to-auto-refresh-page-onevent