Hello everyone,
I have a fairly advanced case and I want to see if anyone has managed to solve it with less complexity based on their experience.
I want to display regional prices internally within the same country but using SSR to avoid affecting the SEO of the website while still using a standard Shopify theme.
In other words, in the United States, each region can have a price associated with each product.
The solution I currently have is:
Each product has a metafield that indicates which price should be shown depending on the region detected (New York, North Carolina…)
Currently, I achieve this by associating them by region and the metafield, but using JavaScript.
I handle the checkout with a Shopify Function that transforms the product value in the cart and processes the purchase.
This leaves me with one additional problem:- I cannot sort the products because sorting can only be done by the base field. I have already implemented the standard price field, but visually the sorting is disrupted by the customization with metafields.
What alternatives am I considering?1. I create variants to manage these prices; however, I cannot sort prices by variants either when using collection sorting.
- I implement the store under Shopify Hydrogen to connect directly to my backend, but this would involve migrating all my templates and optimizing the SEO of the page.
- Use a fictitious field for sorting, such as the title, but this text-based sorting doesn’t work because it sorts 1111 before 4.
- Use a metaobject and store all the sorting information; however, this logic is quite complex to develop because of the variations in how many pages it should have.
- I could easily solve it with JavaScript on the frontend, but the scenario is intended to be fully SSR.
Thanks!