Shopify themes, liquid, logos, and UX
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hello, I am building an app where I'd like to get all the routes for a shopify store programmatically.
Below are some things I tried and possible solutions - If there is a better way to get all routes, that would be amazing, thanks!
Some things that are close, but not what I'm looking for:
Possible Solution
I think some combination of the sitemap + routes object + getting all pages and policies via the api may work, but seems error prone.
Also, I feel like there may be a way to do it with the theme code, but I'm not sure how.
Hi @bensenescu
I see you're trying to get ahold of all the routes in your Shopify store programmatically for your app. That's a great question, and while there isn't a single, built-in method, I can walk you through some options to achieve this:
Why the Built-in Options Won't Work:
Possible Solutions (and Their Quirks):
1-Combining Sitemap + API + Theme Code (Tricky but Feasible):
2-This can be a bit error-prone and requires juggling multiple data sources.
3-Shopify App Options (Explore with Caution):
Here's My Recommendation:
The first approach (combining sitemap, API, and theme code) can work, but it requires a bit of finesse. If you're comfortable with code and Shopify's API, it's definitely doable. However, if you're looking for a simpler solution, consider these alternatives:
Ultimately, the best approach depends on your specific needs.
If you decide to go the coding route and need further guidance on the API or theme exploration, feel free to ask! I'm happy to help you dig deeper.
In the meantime, here are some resources that might be helpful:
Best regards,
Daisy.