How to add an upsell block to Shopify without an app

A "Frequently bought together" row, with matching socks under the hoodie or a case next to the phone, is a common reason store owners install a monthly app. You can build one yourself in an Online Store 2.0 theme, and Shopify also has a free built-in option. Here are both.

Option 1: Shopify's free built-in recommendations

Shopify's free Search & Discovery app lets you set related and complementary products for each product. Dawn's product page can show these with its "Related products" section and "Complementary products" block. If automatic or per-product recommendations suit you, start here. It costs nothing.

It's less suitable when you want a fixed, hand-picked set on a page, such as the cart page or a landing page, with an add-to-cart button on each card.

Option 2: A simple hand-picked upsell section

  1. Go to Online Store → Themes → … → Edit code.
  2. In Sections, click Add a new section and call it simple-upsell.
  3. Replace the contents with the code below and click Save.
  4. In Customize, click Add section → Simple upsell, pick up to 4 products and save.
<div class="simple-upsell page-width">
  <h2>{{ section.settings.heading }}</h2>
  {%- for p in section.settings.products limit: 4 -%}
    {%- assign v = p.selected_or_first_available_variant -%}
    <form action="{{ routes.cart_add_url }}" method="post">
      <a href="{{ p.url }}">{{ p.title | escape }}</a>
      {{ v.price | money }}
      <input type="hidden" name="id" value="{{ v.id }}">
      <input type="hidden" name="quantity" value="1">
      <button type="submit" {% unless v.available %}disabled{% endunless %}>
        {%- if v.available -%}Add to cart{%- else -%}Sold out{%- endif -%}
      </button>
    </form>
  {%- endfor -%}
</div>

{% schema %}
{
  "name": "Simple upsell",
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading", "default": "Frequently bought together" },
    { "type": "product_list", "id": "products", "label": "Products", "limit": 4 }
  ],
  "presets": [{ "name": "Simple upsell" }]
}
{% endschema %}

How it works: the product_list setting gives you a product picker in the theme editor. For each product, the section takes the first available variant and shows a normal Shopify add-to-cart form, which posts to routes.cart_add_url. When a product is sold out, the button is disabled.

page-width is Dawn's container class. Horizon doesn't have one, so on Horizon give the wrapper your own max-width and padding.

What the simple version leaves out

  • Product images. Use image_url and image_tag with widths and sizes so phones don't download desktop-sized images.
  • A grid layout that works on phones, and settings for spacing and the button label.
  • Accessible buttons. Each one should say which product it adds, for example "Add to cart: Socks", so screen-reader users can tell them apart.
  • A hint that only appears in the theme editor when no products are picked, so shoppers never see an empty box.

Or use the ready-made upsell block (£12, one-off)

Our upsell block section does all of that: image cards, a responsive grid, sold-out labels, accessible buttons, an editor-only hint, and its own container so it lays out properly in both Dawn and Horizon. It's tested on Dawn and Horizon. Other Online Store 2.0 themes may need small style tweaks. You pay once. There's no app and no subscription.

See pricing Try the live demo

FAQ

What happens when a shopper clicks Add to cart?

Both the snippet above and our section use Shopify's standard cart form. The item is added and the shopper goes to the cart page. They don't open your theme's cart drawer.

Can I show different upsells on different products?

Each copy of the section has its own product list. For different products, create alternative product templates in the theme editor and assign them to products, or use Search & Discovery's per-product recommendations.