How to automatically refresh a Webflow page after payment redirect to update pro account content? Answered
Hey! Is there a way I can get a page in webflow to automatically refresh when the user is redirected there from the payments page because I have some content that is shown depending on whether or not the user is has a pro account. The feature works fine after I refresh manually, but I am wondering if there is any way I can do it automatically
Comments
2 comments
Yes you can! A simple refresh script works, but it could get a bit trickier because you dont want to create an endless refresh loop! I'll try something for you
Preston Button put this script in the </body> section of the page:
<script> document.addEventListener("DOMContentLoaded", function() { const isReloaded = localStorage.getItem("pageReloaded"); if (!isReloaded) { localStorage.setItem("pageReloaded", "true"); location.reload(); } else { localStorage.removeItem("pageReloaded"); } }); </script>thanks a lot
Please sign in to leave a comment.