Shopify Liquid code library
Original, working Liquid codes for Shopify sections and snippets. Inspect the code, preview the output, copy the files and adapt them for your own theme. No account needed.
10 examples are fully open - inspect and copy the code freely. Everything else previews live but the source unlocks with all-access, the same deal as the paid library.
A dismissible top-of-page message with configurable text, link and colours.
A call-to-action banner with heading, text, button and alignment options.
An accessible accordion built with native details elements, no JavaScript required.
A responsive icon grid for shipping, returns and authenticity claims, driven by section blocks. Adapted from a real storefront build.
A real countdown to a fixed end date set in the theme editor - it does not reset per visitor. Adapted from a real storefront build.
Shows the product's real review rating from the standard Shopify metafield - no hardcoded numbers. Adapted from a real storefront build.
A cart progress bar driven by the real cart total - shows exactly how much more unlocks free shipping.
Tiered 'buy more, save more' pricing rows. Clicking a tier sets the quantity and highlights the deal - pushes average order value up.
A scrolling strip of press or partner marks. Ships with text placeholders - swap in your real logos as images.
A rotating customer quote with stars and name - real social proof under the title or buy button.
A short list of product benefits rendered from a simple text value.
A two-column comparison built from section blocks, with an optional highlighted column.
A Size Chart link that opens a zoomable product metafield image in an accessible modal. Adapted from a real storefront build.
Price, MRP strike-through and discount percentage that updates when the variant changes. Adapted from a real storefront build.
An 'only N left' indicator driven by real variant inventory - it only appears when stock is genuinely low. Adapted from a real storefront build.
A mobile-only sticky bar with the live price that taps through to your theme's real add-to-cart button. Adapted from a real storefront build.
A row of payment-method pills (UPI, cards, COD) that sits under the buy button and answers the 'can I trust this checkout?' question.
A compact shield-and-copy strip that reassures buyers right under the price or add-to-cart button.
Remembers the products a visitor opened and shows them again - brings shoppers back to items they already considered.
Replaces the dead 'sold out' state with a 'notify me' action - keeps the shopper engaged instead of losing them.
A 'Save X%' badge computed from compare_at_price - drops onto product cards or the product page and never lies about the discount.
Tabs for description, shipping and returns on the product page - keeps long content tidy and scannable.
An interactive draggable divider over two images - shows the product's effect better than any bullet point.
Shows the price split into instalments under the price - 'or 3 payments of Rs. X'. Lowers sticker shock on higher-priced items.
'Order in the next 2h 15m for same-day dispatch' - honest urgency based on your real warehouse cutoff.
A cross-sell row pulled from Shopify's product recommendations - suggests the next purchase while intent is high.
A clean key/value specs table fed by metafields - shoppers scan it in seconds instead of digging through the description.
Hover-to-magnify lens over a product image - the #1 action shoppers take on a product page.
Cash-on-delivery and serviceability check by pincode prefix - the #1 question on Indian stores. Enter your covered prefixes; it checks honestly.
Ingredient or materials rows with optional percentage bars - the transparency card DTC brands win on.
A save-for-later heart with a count badge - remembers picks across the visit without an app.
A single line under the product title - stars, count, 'read reviews' anchor link. Small, high-impact.
Metafield-driven accordion - materials, care, sizing, shipping - keeps the PDP clean and scannable.
Three micro-benefits under Add to Cart - the last thing a shopper sees before deciding.
A two-column comparison against 'other brands' - frame the choice honestly.
A 'quick order on WhatsApp' button with a prefilled product message - huge for Indian COD buyers.
Custom text input that saves to the order as a line-item property - names, monograms, messages.
In-stock grid across all variants - shoppers see what's actually available before tapping.
'₹45 / 100g' under the price - essential for groceries, supplements, anything sold by weight or count.
'Earn X points on this order' under the buy button - primes repeat purchase without an app install.
'Already in your cart' chip on the product - stops double-adds and anchors the purchase decision.
A full product card with image, price, rating and buy button - promote one hero product anywhere.
'Made to order - ships in X days' badge - sets expectations honestly for handcrafted sellers.
'Runs true to size' microcopy from a metafield - answers the #1 clothing question inline.
A 'X-year warranty' pill - big-ticket items need this near the price.
'₹X of every order goes to Y' - real cause marketing that actually converts.
'In stock at Bandra, pickup today' per location - local inventory messaging for multi-store merchants.
Visual colour dots for the colour option - the single most-expected feature on fashion stores (96% of premium themes have it).
A 'quick view' overlay on product cards - title, price, image and a link to the full page without leaving the collection.
Shows the product's second image on hover - 92% of premium themes have this 'rollover' effect on cards.
Plus/minus buttons around the qty input - small UX win, present in almost every paid theme.
A visible measurement table (chest/length/sleeve) - different from the modal, always on the page.
'X sold' from a product metafield - real traction beats fake urgency every time.
Side-by-side spec table for 2-3 of your own products - helps shoppers pick the right one.
Switches the buy button to 'Pre-order - ships X' for made-to-order and upcoming drops.
Amazon-style 'have a question?' box - question arrives as a contact message with the product tagged.
'Model is 5'9" and wears M' - the two-line context every fashion PDP needs under the size picker.
When a product is unavailable, show 4 related picks instead of a dead end - recovers the sale.
'Pay online, save X% + skip COD fee' - the nudge that shifts Indian shoppers off COD.
'Does it fit?' - pick your device/vehicle/model and confirm fit before buying. Big for cases, parts, accessories.
Customer uploads a photo for printing/engraving - lands as a line-item property on the order.
FDA-style nutrition panel - standard layout for food, supplements and protein products.
'Restocking Jan 15' - keeps sold-out traffic warm instead of losing it to a competitor.
'Prefer to call? Order on the phone' - converts older and B2B buyers who don't want to check out online.
'Made in India' chip with flag styling - regional pride that converts especially on artisan products.
Laundry symbols row (wash/dry/iron/don't bleach) - answers the care question before it becomes a return.
A PDF link card - 'download the full spec sheet' for technical products.
'SOLD OUT' badge over the product image on grids - an automatic visual, not a label you manually update.
'Notify on WhatsApp' for sold-out products - opens WhatsApp with the product link prefilled.
Bank / tenure / monthly-amount table - the clear EMI breakdown that answers 'can I afford this' upfront.
Height + weight -> suggested size - reduces the #1 return reason on fashion stores.
'Log in for member pricing' - prompts account creation on the PDP without being a hard gate.
'Available for pickup at [location]' - BOPIS badge using Shopify's real pickup availability.
'Open box delivery - inspect before you pay' - the COD trust feature Indian shoppers actively look for.
'All prices include GST' - the transparency Indian buyers check before checkout.
'Ships across India / ships from [city]' - answers 'do they deliver here' before the question forms.
'20+ units? Contact for bulk pricing' - surfaces the B2B option on a retail PDP.
'Order a swatch/sample first' - the try-before-commit CTA for fabrics, materials and custom products.
'Contains nuts / dairy / gluten' - the food safety detail that's legally important, not just helpful.
'Best before Dec 2025' - for food, skincare and anything with shelf life.
Top / heart / base notes layout - the standard perfume description structure.
Visual split bar - '60% cotton, 40% linen' - shows material makeup at a glance.
'#24 of 500' - numbered editions create real scarcity for drops and collectibles.
A stackable conversion kit for the buy area - reorderable blocks: trust points, stock status, delivery estimate, guarantee and payment icons in one section.
Shows an email capture only when the variant is sold out - submits through Shopify's own customer form so the shopper lands in your customer list tagged with the product. Zero app needed.
A product grid where every card has a quick-view button - opens a modal with image, price, variant picker and add-to-cart without leaving the page. The quick-view feature paid themes charge for.
A checkbox that adds a gift message and wrap note as line-item properties - easy AOV lift around gifting seasons.
A 'pairs well' product card inside the cart - the highest-demand upsell pattern. Product picker in theme settings.
2-3 product cards with a combined price and a single 'add all' button - classic AOV lift for fashion and decor.
Variant rows with quantity inputs and one 'add all' - the $31 section B2B and wholesale stores pay for.
'Buy these two together, save X' with a savings pill - the simplest AOV lift that works.
A 'special instructions' textarea on the cart - saves support pings and makes gifting easy.
A reassurance row for cart/checkout pages - secure payment, returns, support in one line.
One-time vs subscribe pill toggle - primes customers for a selling plan without an app's weight.
Amazon-style checkbox bundle - main product + 2-3 picks, combined price, one 'add all' button.
Cart > info > payment steps bar - shows shoppers exactly where they are in checkout.
Pick any 3 products from a grid, see the running total, one 'add bundle' - the subscription-box pattern that lifts AOV.
A date input on the cart that saves to order attributes - 'please deliver after the 15th' without email ping-pong.
'This is a gift' checkbox that unlocks a message field - both save to order attributes.
'I agree to the terms' gate before checkout - a compliance requirement some payment providers ask for.
When the cart's empty, show bestsellers instead of a dead end - recovers the browse loop.
'Add ₹10 to X cause' in the cart - micro-donations convert when the cause is real.
'Reorder in one tap' on the account page - the highest-converting retention feature for consumables.
'Add ₹X more for 15% off' in the cart - real cart-goal progress driven by live cart total, not a fixed bar.
'Pay ₹200 now, rest on delivery' - the RTO-reduction trick Indian COD stores use.
Choose a delivery window (morning/afternoon/evening) - saves to order attributes.
The flagship replacement for paid cart-drawer apps - free-shipping bar, qty controls, remove, subtotal and an optional upsell card. Intercepts the add-to-cart form and opens automatically.
Shows a one-click 'add this too' offer the moment a shopper adds to cart - intercepts the form, offers the upsell, then continues to the cart. Post-purchase upsell apps charge $20+/mo for this.
A compact panel with processing time, free-shipping threshold and returns note.
Icon-led highlights for payment security, returns and support, based on your real policies.
A dark premium card with a PIN-code check, a real delivery timeline and a trust row - the kind of block that lifts product-page confidence. Adapted from a real storefront build.
A masonry grid of customer photos with captions - UGC that converts better than stock shots.
Overall rating, review count and star-distribution bars - the card shoppers scan before reading a single review.
Amazon-style per-attribute bars - quality, fit, value - so buyers see nuance, not just one number.
A single highlighted review with stars, verified badge and the buyer's name - social proof that reads like a person, not a widget.
An 'As featured in' strip of publication names - borrow credibility the honest way: only real mentions.
A pull-quote with a credential - 'recommended by' authority that outperforms anonymous reviews.
A testimonial card with a video play button - 'see it in action' proof MaryRuth-style stores rely on.
A masonry grid of short customer quotes - more convincing than one polished testimonial.
GOTS, vegan, ISO, FSSAI-style certification chips - the proof layer for regulated and DTC categories.
Star picker + review text that posts as a contact form tagged 'review' - collects feedback without an app.
'Found it cheaper? We'll match it' - signals pricing confidence on comparison-shopped products.
'Tag us or upload a photo' - turns buyers into UGC creators with a real submission path.
UPI / GPay / PhonePe / Paytm icons - the payment methods Indian buyers actually look for before trusting a store.
'256-bit SSL secured' under the buy button - the security reassurance that actually affects conversion.
'Secure | Easy returns | COD available' - the three reassurance points buyers check before paying.
'Store replied' card under a review - shows you actually respond, not just collect.
Yes/no vote buttons on reviews - surfaces the actually-useful feedback.
'Verified purchase' chip on reviews - the credibility mark that makes reviews count.
Home > Collection > Product navigation with BreadcrumbList JSON-LD - helps wayfinding and rich results in search.
Instagram-style circular story links - tap-through categories that feel native to shoppers.
Scrollable chip-style nav - filter links that look native on mobile.
Full-width collection banner with image, title and product count - top of every collection page.
Image tiles linking to collections - the visual nav on almost every successful homepage.
A big centered search box with trending searches - put discovery front and center.
A wide multi-column dropdown with featured collections + a promo card - 95% of premium themes have one.
App-like bottom navigation on mobile - home, search, cart, account - the pattern every m-commerce app trains users on.
Live product suggestions as you type - powered by Shopify's real /search/suggest.json endpoint.
Filter the collection by product tags as clickable chips - no app, uses Shopify's native tag filters.
Click-to-call strip above the header - phone, hours and a WhatsApp link. Converts older and B2B buyers.
Slide-in menu with collections and a support footer - the navigation every mobile shopper expects.
Horizontally scrollable category chips that stick under the header - mobile navigation without a hamburger.
Structured footer with Shop / Help / Company columns + contact strip - the nav most stores skip until it's too late.
Hindi / English / regional selector - connects to Shopify's language settings.
'Trending: linen, oversized, black' chips - real search suggestions from what people actually type.
A complete header with logo, dropdown panels (sub-links become columns automatically), promo cards, search, cart count, sticky option and a mobile drawer. What paid header apps sell for $15+ alone.
A responsive grid of collection cards driven by section blocks.
Desktop and mobile images per slide with autoplay and arrow navigation. Adapted from a real storefront build.
The single most-installed section type - image one side, copy + CTA the other, desktop/mobile stacked.
Multicolumn icon + title + caption grid - the 'why us' strip on almost every winning homepage.
A swipeable row of product cards - featured collection without the grid layout.
Numbered steps down a vertical line - 'how it works', brand story or delivery process.
Full-width video or YouTube background hero - motion sells, and most themes ship static banners only.
A clean responsive photo grid - lookbook, room inspo, product-in-context shots.
FAQ with a live filter box - big for stores with 20+ real questions.
'Meet the makers' cards - the trust layer that turns a storefront into a brand.
Side-by-side image panels that expand on hover - a premium lookbook pattern that photographs beautifully.
Tabs that swap between collection grids - 'New in / Bestsellers / Sale' on the homepage without scrolling.
Table of contents from headings plus 'X min read' - makes long blog posts skimmable.
A real hosted video with controls - not a YouTube iframe, for when you want it to feel native to the store.
A thin progress bar at the top while reading blog posts - keeps readers oriented on long content.
'Keep reading' cards for 3 posts in the same blog - keeps readers on your site instead of bouncing.
Name + avatar + short bio under blog posts - signals a real person wrote it, not content-mill filler.
'Our team's favourites' - curated picks with a human angle that bestseller lists don't have.
A full wishlist page that displays products saved by the Wishlist heart button - fetched live, add-to-cart and remove included. Pair it with wishlist-button for a complete no-app wishlist.
Ticket-style offer cards with tap-to-copy and a confirmation toast, driven by section blocks. Adapted from a real storefront build.
A delayed, dismissible popup with a coupon code and tap-to-copy. Adapted from a real storefront build.
A horizontally scrolling strip of short benefits - pauses on hover and respects reduced-motion. Adapted from a real storefront build.
A bottom-left 'just bought' popup cycling through real recent orders you list yourself. Only show genuine sales - fake notifications burn trust.
Pins on a lifestyle image that link to each product in the shot - lookbook-to-cart in one tap.
Animated count-up numbers - orders shipped, customers, years - credibility in 3 digits.
An FAQ accordion that also emits FAQPage structured data - eligibility for Google's rich FAQ snippets.
Email signup with an honest incentive line - converts better than a bare 'subscribe' field.
Share-to-X/WhatsApp/Pinterest buttons with the real product URL prefilled.
Latest-posts grid linking to your profile - social proof + follows without an app.
'Notify me if the price drops' - captures intent from shoppers who aren't ready to buy today.
Fires when the cursor heads for the address bar - one last honest offer before they leave.
A launch page section - big heading, countdown, email capture for the waitlist.
A 'find your X' quiz where every answer points at its own product or collection - converts browsers into buyers, no app needed.
A 'bulk order? talk to us' form - name, company, quantity - the pattern B2B stores pay real money for.
A 'give ₹X, get ₹X' card with tap-to-copy referral link - runs on your real referral URL.
Bronze > Silver > Gold progress bar - gamifies the next purchase.
'Join the drop list' - exclusive-access email capture for launches and limited releases.
'Live sale Sunday 7pm' sticky strip with a join link - builds anticipation for scheduled events.
B2B 'get a quote' CTA that opens a compact form - for bulk/wholesale pricing conversations.
'Become an ambassador' - IG handle + follower count + why, tagged for the collab pipeline.
'Get notified when [collection] drops' - per-collection waitlist for launches.
'Get a gift on your birthday' - DOB + email for the birthday-discount flow.
'We'll call you' - name + number form for buyers who'd rather talk than read a product page.
Diwali/Holi/seasonal banner - the recurring sale hook Indian shoppers expect.
'Share on IG to unlock 10%' - gated discount that trades a coupon for organic reach.
The viral gamified popup - shoppers scratch a foil layer on a real canvas to reveal their coupon code. Session-gated, dismissible, huge email-list and conversion numbers.
The classic gamified popup - a canvas prize wheel with configurable prizes, spins to a random slice and reveals the code. Proven email-list and conversion builder.
A floating button that fades in after the shopper scrolls, then smoothly returns them to the top of the page.
A thin bar pinned to the top of the page that fills as the visitor scrolls - subtle cue that keeps people reading.
A slim bottom banner that asks for consent once, remembers the choice in the browser, and stays away afterwards.
A session-gated 18+/21+ modal for age-restricted stores - remembers the visitor for the session.
Location cards with address, hours and a map link - for multi-location or pickup-enabled stores.
The universal escape hatch - a themed section wrapper that renders any Liquid the merchant pastes.
Live store-hours badge - 'Open now, closes 9pm' that updates from your real hours.
A themed contact block - name, email, message - posting straight to Shopify's contact flow.
Google Maps embed card - 'find our store' without leaving the page.
An order-number + reason return form - saves a support email chain on every return.
Fetches the next collection page and appends the grid - a smoother alternative to page numbers.
A helpful 404 - search box plus popular links instead of a dead 'page not found'.
Font-size + high-contrast toggles floating on the page - genuinely helpful, and WCAG-friendly.
Activate warranty with order number + serial - turns a sale into an owned customer relationship.
'Open today 10am-7pm' - for stores with a physical location or phone support.
'Track your order on WhatsApp' - opens a chat with the order number prefilled. India's preferred support channel.
Type a price, pick a tenure, see monthly amount - answers 'can I afford this' before checkout.
'Chat: online / offline' - shows support availability instead of a dead widget that never answers.
When search returns nothing, show popular categories - recovers the dead-end search.
A product grid where every card has a quick-view button - opens a modal with image, price, variant picker and add-to-cart without leaving the page. The quick-view feature paid themes charge for.
Merino cardigan
Rs 49.00
Linen overshirt
Rs 89.00
Canvas tote
Rs 35.00
Wool scarf
Rs 29.00
Approximate rendering. Your theme's fonts, colours and base styles will apply on the storefront.
The preview works freely - the Liquid source, CSS, JS and downloads unlock with all-access.
Unlock all snippets10 examples are free - this one is in the members set.
These controls mirror how the snippet reads theme settings or render parameters on a real store.
File name shown: sections/quick-view-grid.liquid · These are GPLMart's original teaching examples, not the paid library. They are provided as-is for learning.