Shopify Theme Development Tutorial
Learn Shopify Theme Development step by step: 61 lessons in 11 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is a Shopify Theme? Learn what a Shopify theme is, what it controls compared with apps, how Online Store 2.0 works and how a storefront request becomes a finished HTML page.
- Setting Up: Dev Store, Partner Account and Shopify CLI Set up a Shopify development store, install Shopify CLI, and learn the theme dev, pull, push and check commands plus GitHub integration for theme work.
- The Theme File Structure A tour of the Shopify theme folders: layout, templates, sections, blocks, snippets, assets, config and locales, what each holds, and how they load together.
- Exploring Dawn, the Reference Theme Clone Dawn, read theme.liquid and the main sections, see how a product page is assembled from JSON and blocks, and decide when to fork or start fresh.
- The Theme Editor and How Merchants Use Your Theme See the theme editor through a merchant's eyes: sections, blocks, settings, presets, previews, app blocks and JSON templates, and how to design for non-developers.
Liquid Basics
- Liquid Basics: Output, Objects and Whitespace Learn the core of Liquid: output with double braces, tags, objects, dot and bracket access, comments, whitespace control and truthy and falsy values.
- Conditions: if, unless, case Learn Shopify Liquid conditions: if, elsif, else, unless and case/when, comparison operators, contains, and/or, empty vs blank and nil handling, with live examples.
- Loops: for, break, limit, offset, forloop Learn Shopify Liquid loops: the for tag, forloop object, limit, offset, reversed, ranges, else, break, continue, cycle, tablerow and paginate, with live examples.
- Variables: assign, capture, increment Learn how to create and use Shopify Liquid variables with assign, capture, increment and decrement, plus scope rules, naming, building strings and arrays, and defaults.
- Filters: Strings, Math, Arrays Learn Shopify Liquid filters: chaining, string filters like truncate and replace, math with plus, times and round, array filters like map, where and sort, default and escape.
- Shopify Filters: Money, Images, URLs and Assets Learn Shopify-specific Liquid filters: money, image_url and image_tag, asset_url, stylesheet_tag, t, date, json, handle and URL filters, plus deprecated filters to avoid.
- The Global Objects You Use Most Meet the Shopify Liquid objects you will use daily: shop, request, routes, settings, template, page_title, localization, customer, cart, content_for_header and layout, and where each is available.
- Snippets and the render Tag Learn how Shopify snippets work: the render tag, passing variables, isolated scope, render with and for, why include is deprecated, LiquidDoc comments and nesting limits.
- Liquid Pitfalls and Debugging Avoid the Liquid bugs that bite every Shopify theme developer: truthiness, blank versus empty, string versus number, scope leaks, array building, slow loops and how to debug.
Layouts, Templates and Sections
- Layouts and theme.liquid Understand Shopify layouts: what theme.liquid must contain, content_for_header and content_for_layout, section groups, the password layout, extra layouts and layout none.
- JSON Templates and Online Store 2.0 Learn how Shopify JSON templates work: sections and order, blocks, settings, alternate templates with suffixes, customer templates, Liquid templates and the limits that apply.
- Building a Section Build a Shopify theme section from scratch: file anatomy, the schema tag, setting types, presets, limits, enabled_on, static versus dynamic sections and section.id.
- Blocks and Theme Blocks Learn Shopify blocks: section blocks and shopify_attributes, reusable theme blocks in /blocks, nested blocks, the @theme and @app types, block settings, limits and ordering.
- Schema Settings and Setting Types in Depth Learn every common Shopify schema setting type, from text and richtext to image pickers, ranges, font pickers and visible_if, with safe Liquid patterns.
- Global Theme Settings: settings_schema.json and settings_data.json Learn how settings_schema.json defines global theme settings, how settings_data.json stores values, and how color schemes and fonts become CSS variables.
- Product, Collection, Cart and Page Templates A tour of every Shopify page template: which sections each one needs, the main section pattern, and special cases like gift cards and the password page.
Products, Collections and Variants
- Building the Product Page Build a Shopify product page step by step: the product object, price and compare-at price, media gallery, the product form and the selected variant.
- Variants and Option Pickers Build a Shopify variant picker: read options and variants in Liquid, handle sold-out and missing combinations, update the URL and keep the form in sync.
- Product Media: Images, Video and 3D Show Shopify product media correctly: media types, image_url and image_tag, srcset and sizes, video and 3D tags, alt text and featured media per variant.
- Collection Pages: Sorting, Filtering and Pagination Build a Shopify collection page: loop products, paginate, add sort_by, storefront filters and facets, read filter URL parameters and keep pages fast.
- Search and Predictive Search Build Shopify theme search: the search template and search.results, result types, the predictive search API with fetch, debouncing and no-results states.
- Metafields in Themes Read Shopify metafields in a theme: definitions, types, product.metafields.namespace.key, dynamic sources in the theme editor, rich text, references and safe fallbacks.
- Metaobjects in Themes Use Shopify metaobjects in a theme: definitions and entries, metaobject templates and pages, list references, FAQs, size charts, store locators and the limits.
Cart, Checkout and Customer Pages
- The Product Form and Add to Cart Build the Shopify product form: the form tag, variant id and quantity inputs, line item properties, selling plans, no-JavaScript fallback and dynamic checkout buttons.
- The Ajax Cart API Use the Shopify Ajax Cart API from a theme: cart/add.js, change.js, update.js, clear.js, cart.js, the sections parameter, error handling and rate limits.
- Building a Cart Drawer Build a Shopify cart drawer: refresh it with the Section Rendering API, update quantities optimistically, manage focus for accessibility, and add a shipping bar.
- Cart, Discounts and the Path to Checkout Learn the Shopify cart object, line items, cart attributes and discount display, how shipping estimates work, and what a theme can and cannot change at checkout.
- Customer Accounts and Account Pages Understand Shopify's new and classic customer accounts, the customer templates, login, register and address forms, order history, and safe redirects.
- Forms: Contact, Newsletter and Custom Forms Learn the Liquid form tag: contact and newsletter forms, form.errors and posted_successfully, accessible error messages, spam protection and when to use Shopify Forms.
JavaScript, CSS and Design
- JavaScript in Themes: Web Components and Events Write modern Shopify theme JavaScript with custom elements, pub-sub events, module scripts, defer and the theme editor events, without jQuery.
- CSS for Themes: Variables, Layout and Responsiveness Style Shopify themes with CSS variables from theme settings, color schemes, grid, container queries and mobile-first rules; learn the stylesheet and style tags.
- The Section Rendering API and Dynamic Updates Use the Shopify Section Rendering API to fetch fresh section HTML, swap it into the page and update variants, carts and filters without a full reload.
- Translations, Markets and Localization Make a Shopify theme speak many languages and currencies: locale files, the t filter, plurals, schema translations, selectors, Markets and right-to-left.
Performance and Quality
- Theme Performance and Core Web Vitals Make a Shopify theme fast: understand LCP, CLS and INP, load images and fonts correctly, tame render-blocking code and app scripts, and read speed reports.
- Liquid Performance: Loops, Objects and Limits Write faster Liquid: avoid nested loops and heavy filters, respect paginate limits, choose render over include, and find slow sections with the theme profiler.
- Accessibility in Themes Build accessible Shopify themes: landmarks, headings, skip links, keyboard menus, live cart announcements, contrast, reduced motion, labels and screen reader testing.
- SEO in Themes Make a Shopify theme search-friendly: titles, meta descriptions, canonical URLs, Open Graph, product JSON-LD, robots.txt.liquid, hreflang and image alt text.
- Theme Check, Linting and Testing Catch Shopify theme bugs before merchants do: run Theme Check, configure .theme-check.yml, gate pull requests in GitHub Actions and Lighthouse CI, and test in the editor.
- Security in Themes Secure your Shopify theme: stop XSS with the escape filter, output data safely into HTML, attributes and scripts, handle customer data and judge third-party scripts and app embeds.
Apps, Integrations and Extensibility
- App Blocks and App Embeds Learn how Shopify apps add UI to Online Store 2.0 themes: support @app blocks in your sections, understand app embeds, uninstall cleanup and what merchants see in the editor.
- Storefront API and Fetching Data from a Theme Learn when a Shopify theme should call the Storefront API instead of Liquid or the Ajax APIs: tokens, GraphQL queries, rate limits, caching and safe error handling.
- Webhooks and Orders for Theme Developers What a theme developer needs to know about Shopify webhooks, order notification templates and the order lifecycle, with a runnable signature check and email stand-in.
- Theme App Extensions and Third-Party Scripts How theme app extensions are built, how to load third-party code without hurting speed, how consent banners gate tags, and what Customer Events pixels change for analytics.
Publishing and Maintenance
- Version Control and Team Workflows Manage a Shopify theme with Git: GitHub integration, one branch per theme, theme pull and push, .shopifyignore, and merging merchant edits to JSON files.
- Testing, Publishing and Going Live Preview, test and publish a Shopify theme safely: preview links, a QA checklist, rollback by republishing, password page, domain setup and a launch checklist.
- Theme Store Requirements and Selling a Theme Plan a theme for the Shopify Theme Store: presets, documentation, support, performance and accessibility bars, licensing and pricing, plus a self-review checklist.
- Migrating Legacy Themes to Online Store 2.0 Upgrade an old Shopify theme: turn Liquid templates into JSON templates, move page code into sections, add section groups, and replace deprecated tags and filters.
- Maintaining Themes: Updates and API Versions Keep a Shopify theme healthy for years: follow the quarterly API release cycle, handle deprecations, merge upstream Dawn updates, and write a changelog.
Projects
- Project: A Configurable Hero Banner Section Build a Shopify hero banner section with an image picker, text and button blocks, an overlay, responsive images, a color scheme setting and presets.
- Project: A Product Card Snippet with Quick Add Build a reusable Shopify product card snippet: documented arguments, sale and sold-out badges, a second image on hover, and a quick add button using the Ajax cart API.
- Project: An Accessible Mega Menu Build an accessible Shopify mega menu from a linklist: nested menu data, disclosure buttons with aria-expanded, keyboard support, Escape handling and a mobile drawer.
- Project: A Size Guide with Metaobjects Build a size guide on a Shopify product page: define a metaobject, link it with a product metafield, render an accessible table in a modal and add safe fallbacks.
- Project: A Product Bundle Builder Build a Shopify bundle builder: a section with product blocks, a multi-select UI, one Ajax call that adds many lines, line item properties and an honest discount note.
Practice and Review
- Practice Exercises with Solutions Twelve graded Shopify theme exercises with runnable solutions: Liquid loops and filters, schema checks, cart math, variant logic and accessibility fixes.
- Shopify Theme Developer Interview Questions 30 Shopify theme developer interview questions with concise answers: Liquid, sections, Online Store 2.0, performance, the Ajax cart API and metafields.
- Shopify Theme Cheat Sheet A one-page Shopify theme cheat sheet: Liquid tags and filters, schema setting types, Ajax cart endpoints, Shopify CLI commands and the theme file structure.