Well done for the above. ![]()
However there is a tutorial already which was made by Yisrael (Wix Admin) in Jan 2019 which you could have used as a solution or a starting point for this.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-back-button
Also, you might want to vote for these too.
https://support.wix.com/en/article/request-adding-a-back-button
https://support.wix.com/en/article/request-choosing-where-the-back-button-redirects-to-in-wix-events
https://support.wix.com/en/article/request-adding-a-back-button-to-your-product-page
There is also a Corvid tutorial for next and back buttons on a dynamic page.
Corvid Tutorial: Creating Previous and Next Buttons for a Dynamic Item Page with Code