Integrating SM Product Options with Shopify Functions, Discounts & Upsells

Shopify’s composable backend now allows deeper customization with Shopify Functions. Meanwhile, apps like SM Product Options empower merchants to offer detailed personalization—from engraving fields to image uploads. But how can you combine both for a seamless discount and upsell strategy?

This guide walks you through how to bridge SM Product Options and Shopify Functions to enhance upsells, apply discounts, and create smarter product experiences.

What Are Shopify Functions?

Shopify Functions are custom backend extensions that run directly on Shopify’s servers. They let developers customize:

  • Product & order discounts
  • Shipping rates and rules
  • Payment options
  • Checkout validations

They’re upgrade-safe, fast, and ideal for Shopify Plus merchants.

What Is SM Product Options?

SM Product Options lets you:

  • Add unlimited custom product options (e.g., engraving, gift wrap)
  • Use conditional logic to show/hide fields
  • Charge additional fees for addons
  • Store custom input in line_item.properties

The Challenge

Shopify Functions operate on product/variant IDs and do not natively read line_item.properties added by apps like SM Product Options. This creates a disconnect if you want to apply:

  • Discounts based on custom selections
  • Upsells triggered by certain add-ons
  • Bundles linked to optional inputs

Integration Strategy

1. Identify Custom Selections

SM Product Options stores user selections like this:


"properties": {
  "Gift Wrap": "Yes",
  "Message": "Happy Birthday!"
}
  

2. Sync Values to Cart Attributes or Metafields

Use JavaScript or Liquid to sync these values into cart.attributes or metafields so Shopify Functions can access them indirectly.

3. Use Shopify Functions to Trigger Discounts

Build a Shopify Function (Rust or Hydrogen API) that:

  • Scans the cart for eligible products
  • Checks cart attributes or tag logic
  • Applies discount based on custom options

Note: Shopify Functions cannot read line_item.properties directly. You must pre-process them.

4. Upsell Based on Options

Use post-purchase or cart page apps (like ReConvert or Zipify) to show upsells based on the presence of certain cart attributes or options:

  • If "Add Engraving" = Yes → Offer premium packaging
  • If image uploaded → Offer faster processing

Example: Engraving-Based Discount

Scenario: Offer 15% off if 3 or more engraved products are purchased.

  1. Customer selects "Add Engraving" via SM Product Options.
  2. Script stores this in cart attributes or metafields.
  3. Shopify Function checks cart for engraved items.
  4. If count ≥ 3, apply 15% discount.

Recommended Tools

  • SM Product Options (for custom inputs)
  • Shopify Functions (for discount logic)
  • GTM + GA4 (to track option performance)
  • ReConvert / Zipify (for post-purchase upsells)
  • Shopify Plus (for checkout UI extensions)

Best Practices

  • Clearly label option fields to enable easy matching in reports or discounts.
  • Sync line_item.properties to cart.attributes for better integration.
  • Use consistent naming for custom inputs.

Final Thoughts

Combining SM Product Options and Shopify Functions allows you to create smarter upsells, flexible discounts, and personalized experiences that drive AOV and loyalty.

Need help connecting them? We can provide:

  • Custom Shopify Function setup
  • Line item → cart attribute mapping script
  • GTM & GA4 tracking templates for option performance

Ready to power up your store’s personalization engine? Let’s make it happen.

Back to blog