abc Posted September 17 Share Posted September 17 Hello, I would like to achieve the following (I assume, JavaScript is needed): When visitors visit my online store at example.com/store, I want my visitors to be automatically redirected to one of the store categories at example.com/store/category. Thank you in advance. Link to comment
Solution Spark-Plugin Posted September 18 Solution Share Posted September 18 (edited) Hello @abc I hope you're having a great day! Here’s a code you might find useful, Navigate to: Settings > Advanced > Code Injection. Scroll down to the "Header" section and paste the code above. Replace /store/category with the actual path of the category page you want to send visitors to. <script> if (window.location.pathname === '/store') { window.location.href = '/store/category'; } </script> Edited September 18 by Spark-Plugin abc 1 - Answered by Iuno from sparkplugin.com Link to comment
abc Posted September 18 Author Share Posted September 18 2 hours ago, Spark-Plugin said: Hello @abc I hope you're having a great day! Here’s a code you might find useful, Navigate to: Settings > Advanced > Code Injection. Scroll down to the "Header" section and paste the code above. Replace /store/category with the actual path of the category page you want to send visitors to. <script> if (window.location.pathname === '/store') { window.location.href = '/store/category'; } </script> Thank you so much! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment