Create Dynamic Upsell Blocks for Every Product Page

Pre-requisites:

Before you begin, ensure you have:

  1. Dynamic Content & Settings Per Product
  2. Dynamic fields: Metafield and Metaobjects
  3. Product Variant Metafields/Metaobject Guide

Overview

By using product metafields and connecting them to your Upsell block, you can dynamically show different upsell products per product page, without manually selecting products in the theme editor every time.

Step 1: Create a Product Metafield Definition

  1. In your Shopify admin, go to Settings.
  2. Navigate to Metafields and metaobjects.
  3. Under Metafield definitions, click Products.

  4. Click Add definition.

  5. In the new definition:
    • Name your metafield definition (required).
    • Add a Description (optional).
    • Set Content type to Product (required).
    • Choose List of products.

  1. Double-check all fields, then click Save.

Step 2: Connect the Metafield to Your Upsell Block

  1. In your Shopify admin, open the Theme editor.
  2. Select the Upsell block.

  3. Next to the Products field, click the database icon (triple stacked circles).

  4. From the metafield list, choose the metafield definition you created (for example, upsell_ss_theme ).

  5. Save your theme settings.

Step 3: Add Products to the Metafield

  1. Go to Products in your Shopify admin.
  2. Open a product you want to add to the dynamic upsell block.
  3. Scroll down to Product metafields.
  4. Find the metafield you created and select the upsell products you want to include.

  5. Click Save.

Tip: If you can’t find your metafield, you may have too many pinned definitions. Click View all to see the full list.

Expected output:


After completing the steps above, your product pages will display upsell products dynamically, without needing to manually select them in the theme editor.

To add upsell products to more products, simply repeat Step 3 for each product.


If you have any questions, feel free to contact us. We're always here to help.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us