Blog Sections Open
Sorting getResources by Two TV Fields in a Predictable Order
If a catalog needs to sort first by size and then by price, treat the requirement as a true multi-key sort rather than a single sortbyTV tweak.
Single-TV sorting is straightforward in getResources, but once a listing must sort first by one TV and then by another, the problem becomes a multi-key ordering question. The simple &sortbyTV parameter is not always enough on its own.
Practical options
- use a custom SQL sort expression if the project allows it
- prepare a combined sortable value in advance
- switch to a listing tool that gives more control over joined TV sorting
For example, if size and price are both numeric and both important, you may need a query that explicitly orders by size first and price second, rather than trying to force a single TV sort parameter to do both jobs.
As with many catalog problems, the cleaner the data model is, the easier the sorting becomes.
Choosing a Default YAMS Language from Visitor Geolocation
A practical approach for selecting the initial YAMS language based on visitor geography without overcomplicating the whole multilingual setup.
Debugging Shopkeeper Order Submission When eForm Mail Hooks Cause a White Screen
What to check when Shopkeeper order email hooks break the request and the checkout form ends on a blank page.