Salta ai contenuti

Storefront data

Questi contenuti non sono ancora disponibili nella tua lingua.

Storefront data writes your live discounts into your store. DiscountOS stores them in Shopify as metafields on your products, your collections and your shop. Your theme reads them with Liquid when it renders a page.

The data is part of the page when Shopify renders it. The theme does not call DiscountOS to get it.

These screens are a Dawn theme on a test store. Every discount detail on them is read from Storefront data.

Product page. The price after the automatic discount for the selected size and colour, with the original price struck through. Under Add to cart, a box listing other offers for this product: spend thresholds, free shipping, a bundle and a members line.

A product page for Merino Crewneck Sweater. Under the title: $69.00 in red, $89.00 struck through and Save 22%, then Crewneck at $69, applied at checkout. Size and colour buttons, quantity and Add to cart. Under the button a light grey box: Spend $75, get 10% off your order. Spend $150, get 15% off. Free shipping on orders over $80. Get it with the Cashmere Blend Scarf for $120.00 together. Members may get more. Sign in to see your price. The top bar reads Free shipping on orders over $80

Collection page. The collection’s best offer and how far the cart is from each order reward, above product cards with the discounted price.

A collection page. A light grey strip reads 20% off Autumn Layering, Autumn Layering Sale. Taken off at checkout, no code needed. On its right: You're $53.00 away from 15% off your order, over a line with steps at $75 10% off, $80 Free shipping and $150 15% off. Below, four product cards: Merino Crewneck Sweater $69.00, $89.00 struck, −22%. Cashmere Blend Scarf $52.00 −20%. Ribbed Merino Beanie $28.00 −20%. Wool Overshirt $103.20 −20%

Cart. The same steps inside the cart drawer, and the free gift the cart has reached.

A cart drawer over the collection page. Two lines: Ribbed Merino Beanie $28.00 with Autumn Layering Sale, and Merino Crewneck Sweater $69.00 with Crewneck at $69. Then You're $53.00 away from 15% off your order with the $75 and $80 steps reached. Your free gift: Travel Laundry Pouch. Conditions apply at checkout. Subtotal $87.30 USD with Spend $75, save 10% (−$9.70)

The same data also covers:

  • A “Save up to 20%” badge from the ready-made best value.
  • A quantity-break table with the price per item.
  • A button that copies a discount code.
  • A countdown for offers with an end date.

Examples has the Liquid for each of these. Layout notes explains how the screens above are put together.

  • Only live discounts are in the data. A scheduled discount appears after its start time. An ended or turned-off discount is removed.
  • Your DiscountOS automatic discounts are in by default. Discount codes, Shopify’s own discounts and other apps’ discounts are added when you tag them dos:publish. See Which discounts are published.
  • The data is in three places: on each product a discount applies to, on each collection it targets, and on the shop for discounts that cover the whole store, the order or shipping.
  • It updates when your discounts change. When a discount is created, edited, starts or ends, DiscountOS rewrites the data, usually within a minute. A tag change can take up to about 2 minutes. See When the data changes.
  • You turn it on in the app. Open Manage discounts. Storefront data is the line at the bottom of the discount list. See Turn it on and control it.
  1. Turn it on and control it
  2. Which discounts are published
  3. Read the data in Liquid
  4. Data reference
  5. Show the right offers to each shopper
  6. Examples
  7. Layout notes
  8. When the data changes