I’m developing a Shopify app using Remix, and I want to redirect users to the pricing plan page I’ve set up for my app in the Shopify admin.
Here’s the plan page link: https://admin.shopify.com/store/{store_handle}/charges/{app_handle}/pricing_plans
I’m using App Bridge for managing Shopify functionalities. Below is a simplified version of my App.jsx file:
<ui-nav-menu>
<Link to="/app/sections">Sections</Link>
<Link to="/app/bundles">Bundles</Link>
<Link to="/app/emails">Email templates</Link>
<Link to="/app/my-library">My Library</Link>
<Link to="/app/helpcenter">Help Center</Link>
<Link to="/app/request-section">Request Section</Link>
<Link to={`shopify://admin/charges/${appHandle}/pricing_plans`} rel="list">Plans</Link>
</ui-nav-menu>
However, the above code doesn’t seem to work as expected. I’m not sure if I am implementing the redirect correctly using App Bridge. My goal is to redirect the user to the Shopify admin plan page whenever they access the app.
Is there a better approach to handle this, or am I missing something with App Bridge?
Any help or guidance would be greatly appreciated!
2
Answers
I am unable to redirect to the Shopify payment page from the
app.jsx
file. I have created a newapp.pricing.jsx
page and added it to theapp.jsx
file. Now redirect the user to the Shopify payment page from the pricing page. Below is the code for myapp.pricing.jsx
page code.If you are using the Remix template, you can do this by implementing the Pricing Plans page in the
app.index.jsx
file located at/app/routes
. Your user will land on the pricing page whenever they open the app.Moreover, you can give it’s link in the Navbar too in the
App.jsx
file, if you don’t want to implement it in the index page. You would do something like: