You can now retrieve a product via a handle using the following:

{% assign someProduct = all_products.some-handle %}

Documentation

Answer from Jason on Stack Overflow
🌐
Shopify
shopify.dev › docs › api › liquid
Liquid reference
Liquid tags are used to define logic that tells templates what to do. Tags are wrapped with curly brace percentage delimiters {% %}. The text within the delimiters is an instruction, not content to render. In the example to the right, the if tag defines the condition to be met. If product.available returns true, then the price is displayed.
🌐
Shopify
shopify.com › partners › blog › 96667526-shopify-tutorial-the-product-liquid-template
Shopify Tutorial: The product.liquid template - Shopify
If you are new to Shopify themes, product.liquid is the template that is rendered by default whenever a customer views a product detail page. As discussed in a previous tutorial, it is also possible to have alternate product templates.
🌐
Shopify
shopify.com › partners › blog › 89205510-how-to-use-all_products-in-a-shopify-theme
How to Use all_products in a Shopify Theme - Shopify
​A Shopify tutorial that walks you through how to effectively use the all_products attribute in Liquid when designing Shopify Themes.
🌐
Shopify
shopify.com › partners › shopify-cheat-sheet
Shopify Cheat Sheet — A resource for building Shopify Themes with Liquid
If there is already a product with the handle ‘shirt’, the handle will auto-increment. In other words, all ‘shirt’ products created after the first one will receive the handle shirt-1, shirt-2, and so on. Learn more ... Liquid has access to all of the logical and comparison operators.
🌐
Shopify Community
community.shopify.com › shopify discussion
How get product by id inside liquid template?
July 2, 2021 - Hello I would like to get a product by ID but I don’t know how to do that. The product ID is 2 Please don’t tell me “you can use all_products” using this code: {% for product in collections.all.products %} {% if product.id == 2 %} {% assign my_product = product %} {% endif %} {% endfor %} or: {{ all_products['2'] }} I cannot use “all_products” because I have many many products (10000 products).
🌐
Wecanflyagency
wecanflyagency.com › blog › what-is-shopify-liquid
What is Shopify’s Liquid and where can you learn about it? | wecanfly
The primary function of Liquid is to load dynamic content onto online stores, which means that users have extensive control over how their product images, text, and other relevant details are displayed.
Find elsewhere
🌐
Shopify Help Center
help.shopify.com › en › manual › shopify-flow › concepts › variables
Shopify Help Center | Variables in Shopify Flow
For example, you can use the variable {{ order.name }} to display the order string from the Shopify admin, such as order-123. Because Flow uses the Admin API to retrieve the data used for Liquid, the variable syntax uses "camel case". For example, to access the date a product was created, enter {{ product.createdAt }}. If you use the Liquid syntax in a Shopify theme, then you would enter {{ product.created_at }}.
🌐
Yotpo
support.yotpo.com › docs › shopify-finding-your-liquid-files
Shopify: Finding Your Liquid Files Tips & Quick Solutions We are collecting votes for this issue
Go to your Shopify Themes menu. Click Actions > Edit Code. Go to Sections. Locate the main-product.liquid file.
🌐
Codingwithjan
codingwithjan.com › blog › shopify-tutorials › what-is-shopify-liquid
What is Shopify Liquid? (A guide for beginners)
May 22, 2025 - In simple terms, Liquid is the templating language that powers every Shopify theme. It’s what makes your online store dynamic. Instead of adding product data into your product page's code, Liquid will do the work for you.
🌐
Markdunkley
cheat.markdunkley.com
Shopify Cheat Sheet - Liquid variables
The general idea is that you simply define an input field named “note” in the form that submits to ”/cart” in cart.liquid. ... The attributes property is similar to the note property above in that it is an optional field you can add to your shop’s checkout form. Simply define an input field named “attributes[]” and it will be captured automatically and displayed on the order detail page in your admin area. ... Returns a collection of this linklist's links. ... The object the link points to. If the link points to a product {{link.product.title}} will, for example, print the name of the product.
🌐
Stack Overflow
stackoverflow.com › questions › 76926137 › using-shopify-liquid-i-want-to-get-the-product-object-from-blocks
Using Shopify Liquid I want to get the product object from blocks - Stack Overflow
Is there any way to get the entire product object without naming each one specifically. The code below works for collections, but not blocks. {%- liquid assign ss = section.settings assign collection = collections[ss.based_on_collection] -%} {% assign productsArray = "" %} {% if ss.carousel_type == 'manual' %} {% for block in section.blocks %} {% assign productJSON = block.settings.product | json %} {% if productsArray == "" %} {% assign productsArray = productJSON %} {% else %} {% assign productsArray = productsArray | append: "," | append: productJSON %} {% endif %} {% endfor %} {% elsif ss.
🌐
Shopify
shopify.com › partners › blog › 115244038-an-overview-of-liquid-shopifys-templating-language
An Overview of Liquid: Shopify's Templating Language - Shopify
For example, the product.liquid template allows us access to all the details relating to the currently viewed product. Liquid, in turn, allows us to output this data without having to know anything about the actual product itself.
🌐
Shopify
shopify.github.io › liquid-code-examples
Shopify Liquid code examples
This example includes product images with product titles, prices, and vendors, as well as a title and description for the collection as a whole. There is a limit of 50 products per page, after which pagination will automatically occur.collections · Commenting on blogs is an optional setting which can be enabled from the main Shopify admin.
🌐
GitHub
gist.github.com › jtwray › 9916420a950a0db2b025d8a738763484
Shopify Liquid Cheatsheet · GitHub
Shopify Liquid Cheatsheet. GitHub Gist: instantly share code, notes, and snippets.
🌐
Shopify
shopify.github.io › liquid-code-examples › example › show-product-sku
Show product SKU | Shopify Liquid code examples
Shopify Liquid code examples · Build and customize themes faster with component-based Liquid examples · < Browse library · Last updated: Feb 21, 2019 · Products · Stock keeping units (SKUs) are used to identify products and track inventory. You can display the unique SKU for a product and its variants on the product page.
🌐
Practical Ecommerce
practicalecommerce.com › home › plain-english guide to shopify liquid
Plain-English Guide to Shopify Liquid - Practical Ecommerce
January 27, 2025 - Liquid is a bridge between a store’s content and how it’s displayed. The template resides in a file with the .liquid suffix for every page or section. Hence main-product.liquid contains the product template.
🌐
Hey Carson
heycarson.com › home › what is shopify’s liquid?
What Is Shopify Liquid (What Is It, Uses & Access)
January 30, 2023 - For content that changes or dynamic content, Shopify uses Liquid. This data is changed by the store owner through the theme editor or the admin dashboard and includes things like product price, quantity, and so forth.