Shopify tricks
Small things that save time in a Shopify store: URLs that do more than they look, admin shortcuts and Liquid tricks. Each one is checked on a live store and dated.
In short
These are short, checked how-tos for things Shopify can already do but rarely explains in one place: links that fill a cart or apply a discount, URLs that return a product as JSON, alternate templates, admin search syntax, hidden bulk editor columns and Liquid debugging. Each page gives the short answer first, then an example you can copy, and the date we last checked it.
- 26 pages, free to use in any store, including client work (MIT license)
URL tricks
Storefront URLs that add to cart, apply discounts, switch templates or return data.
Cart permalinks: links that fill the cart
Build a Shopify link that adds products to the cart and opens checkout: /cart/variant-id:quantity, with discount codes, email and the cart page.
Add-to-cart links and buttons that keep the cart
Add a product to the Shopify cart without emptying it: the product form to /cart/add with return_to, the /cart/add.js call, and when to use a permalink instead.
The ?view= parameter: render any alternate template
Render a product, collection or page with an alternate template by adding ?view=suffix to its URL, for previews, quick views and landing pages.
Share an unpublished theme preview
Send an unpublished Shopify theme preview to a client or team: visitor links on shopifypreview.com, merchant previews, expiry and the preview_theme_id bug.
Product .js, cart.js and the other JSON URLs
Read a Shopify product, the cart, recommendations or search suggestions as JSON on the storefront: /products/<handle>.js, /cart.js and other Ajax API URLs.
Collection sort_by and filter URLs
Link to a sorted or filtered Shopify collection: every sort_by value and the filter.p / filter.v parameters for type, vendor, tag, price, stock and options.
/collections/all, vendor and product type pages
Pages every Shopify store has without creating them: /collections/all, /collections, and the vendor and product type pages at /collections/vendors?q=.
Discount links that apply a code automatically
Share a Shopify link that applies a discount code automatically and lands on any page: /discount/CODE?redirect=/collections/summer, plus the QR code.
Search URL parameters and the predictive search URL
Every parameter the Shopify /search page accepts (q, type, options[prefix], options[unavailable_products], sort_by, page) and the /search/suggest.json endpoint.
Section Rendering API: ?sections= and ?section_id=
Fetch the HTML of up to five Shopify theme sections with ?sections= or one with ?section_id=, in the context of any page, to update content without a reload.
Admin deep links: product, variant, JSON and bulk editor URLs
Shopify admin URLs worth bookmarking: product and variant pages, the product page as JSON, the bulk editor on one metafield column and short settings links.
Market and language URLs: /fr/, /en-ca/ and ?country=
How Shopify builds international URLs: subfolders like /fr/ and /en-ca/, subdomains and domains, ?country= deep links and locale-aware links in themes.
Admin tricks
Search, bulk editing, exports and test orders.
Admin search syntax: filters, OR, NOT and ranges
Search the Shopify admin like a developer: field:value filters, OR, NOT, ranges and wildcards for products, orders and customers, saved as a view.
Bulk editor columns you don’t see by default
Add the Shopify bulk editor columns that aren’t shown by default (theme template, metafields, barcodes) and open the editor on one metafield with a URL.
Shopify admin keyboard shortcuts
Open the full Shopify admin shortcut list with ?, search with Cmd/Ctrl+K, add a product with A then P, and the theme editor and bulk editor shortcuts.
Product CSV columns: what’s required and what overwrites
The Shopify product CSV columns that matter: required fields, option columns that protect variant IDs, the overwrite checkbox, metafield and market columns.
Tag orders automatically with Shopify Flow
Tag new Shopify orders automatically with a free Flow workflow: Order created, a condition (shipping method, customer tag, SKU) and the Add order tags action.
Test orders with the Test payment gateway (Bogus Gateway)
Place Shopify test orders without real charges: the Test payment gateway (formerly the Bogus Gateway), card numbers 1, 2 and 3, and cleaning up afterwards.
Find product, variant and customer IDs
Where Shopify product, variant and customer IDs live: the admin URL, the .json trick, a variant ID report, the storefront .js URL, Liquid and the Admin API.
Discount combinations: what stacks and what doesn’t
Which Shopify discounts can stack: product, order and shipping classes, the Plus-only same-item rule, the 5-code limit and the calculation order.
Liquid and theme tricks
Debugging, template switches and hiding things the right way.
Debug Liquid with the json filter
See what a Liquid object contains: {{ product | json }} in the console or a <pre> block, only in the theme editor, plus the safe way to pass data to JS.
request.design_mode and request.page_type
Use request.design_mode to keep analytics out of the theme editor and show editor hints, and request.page_type to load scripts only on the pages that need them.
Alternate product templates for different layouts
Give some Shopify products a different layout: create product.<name>.json in the theme editor, assign it per product or in bulk, read template.suffix in code.
Hide a product from search with seo.hidden
Hide a Shopify product, page or blog post from Google, the sitemap and storefront search with the seo.hidden metafield, and when Unlisted status fits better.
A password page that collects emails before launch
Use Shopify’s private mode as a launch page: password, visitor message, an email sign-up tagged for launch day, the password template and how to go public.
Get a variant ID from the storefront
Find a Shopify variant ID without the admin: the ?variant= URL, /products/<handle>.js, a console one-liner and selected_or_first_available_variant in Liquid.
About the code
- Checked on a Shopify store on the date shown. Shopify changes its admin often; if a step looks different, the idea usually still works.
- Examples use placeholder IDs and your-store.myshopify.com. Replace them with your own.
- MIT license for the code snippets.
Need this built, tested and maintained for your store? See Shopify development.
Questions
- Do these tricks need an app?
- No. Every trick uses what Shopify already has: storefront URLs, the admin, Liquid or Shopify Flow. Pages that need a theme edit say so and show the code.
- Do they work on every Shopify plan?
- Yes, unless the page says otherwise. Shopify Flow is available on Basic and above.
- Are they safe for SEO?
- Yes. Where a URL creates a duplicate view of a page, such as ?view= or sort_by, Shopify’s canonical tag still points at the main URL. The pages note the cases where you should not link to the trick URL from your site.
