# Shopify tricks

> Useful Shopify tricks, checked on a live store: cart permalinks, .js and .json URLs, alternate templates, admin search, bulk editor columns and more.

Page: https://lintelagency.com/resources/shopify-tricks

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.

- 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.

## URL tricks

- [Cart permalinks: links that fill the cart](https://lintelagency.com/resources/shopify-tricks/cart-permalinks): 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](https://lintelagency.com/resources/shopify-tricks/add-to-cart-links): 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](https://lintelagency.com/resources/shopify-tricks/alternate-templates-view-parameter): 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](https://lintelagency.com/resources/shopify-tricks/preview-theme-id): 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](https://lintelagency.com/resources/shopify-tricks/product-js-and-json-endpoints): 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](https://lintelagency.com/resources/shopify-tricks/collection-sort-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](https://lintelagency.com/resources/shopify-tricks/collections-all-and-vendors): 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](https://lintelagency.com/resources/shopify-tricks/discount-links): 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](https://lintelagency.com/resources/shopify-tricks/search-url-parameters): 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=](https://lintelagency.com/resources/shopify-tricks/section-rendering-api): 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](https://lintelagency.com/resources/shopify-tricks/admin-deep-links): 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=](https://lintelagency.com/resources/shopify-tricks/market-and-language-urls): 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

- [Admin search syntax: filters, OR, NOT and ranges](https://lintelagency.com/resources/shopify-tricks/admin-search-syntax): 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](https://lintelagency.com/resources/shopify-tricks/bulk-editor-hidden-columns): 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](https://lintelagency.com/resources/shopify-tricks/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](https://lintelagency.com/resources/shopify-tricks/csv-import-export-columns): 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](https://lintelagency.com/resources/shopify-tricks/auto-tag-orders-with-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)](https://lintelagency.com/resources/shopify-tricks/test-orders-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](https://lintelagency.com/resources/shopify-tricks/find-product-variant-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](https://lintelagency.com/resources/shopify-tricks/discount-combinations): 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

- [Debug Liquid with the json filter](https://lintelagency.com/resources/shopify-tricks/debug-liquid-with-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](https://lintelagency.com/resources/shopify-tricks/design-mode-and-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](https://lintelagency.com/resources/shopify-tricks/alternate-product-templates): 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](https://lintelagency.com/resources/shopify-tricks/hide-product-from-search): 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](https://lintelagency.com/resources/shopify-tricks/password-page-for-launches): 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](https://lintelagency.com/resources/shopify-tricks/variant-id-from-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.

## 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.
