{
  "asset": "Shopify product and order discount calculator",
  "inputs_are_worked_examples": true,
  "source_checked": "2026-11-07",
  "model_module": "../engine.mjs",
  "model_sha256": "d4fd93ac70d8d69cc78dbd69e856136ac5f39620aaec94b62e0c36b469fb3088",
  "publisher": "Said Maybe",
  "asset_url": "https://saidmaybe.com/resources/shopify-discount-combination-cases/",
  "source_references": [
    {
      "title": "Shopify, discount combinations",
      "url": "https://help.shopify.com/en/manual/discounts/discount-combinations",
      "captured": "2026-11-07",
      "scope": "Product-before-order calculation and additive percentage order reductions; app/account eligibility is separate."
    }
  ],
  "scope": "Use the arithmetic only after eligibility and native combination settings have been established. The tool does not choose the best discount, reproduce app behavior, allocate rounding across line items or inspect Shopify Plus same-line product rules.",
  "cases": [
    {
      "brand_id": "saidmaybe",
      "case_id": "worked-initial-case",
      "inputs": {
        "subtotal": 100,
        "product": 20,
        "orderA": 10,
        "orderB": 20,
        "scope": "Native, combination allowed"
      },
      "expected_error": null,
      "expected_result": {
        "title": "Compare this expected subtotal with the cart",
        "summary": "Apply the product reduction first. Both order percentages use that revised subtotal, rather than discounting sequentially.",
        "records": [
          [
            "Subtotal before discounts",
            100
          ],
          [
            "Product reduction",
            20
          ],
          [
            "Subtotal used for both order percentages",
            80
          ],
          [
            "Combined order reduction",
            24
          ],
          [
            "Expected subtotal before shipping/tax",
            56
          ]
        ],
        "note": "Declared arithmetic only. Eligibility, Shopify Plus same-line product rules, allocation rounding, app behavior, shipping and tax are not inferred."
      },
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    },
    {
      "brand_id": "saidmaybe",
      "case_id": "product-before-order",
      "inputs": {
        "subtotal": 100,
        "product": 20,
        "orderA": 10,
        "orderB": 20,
        "scope": "Native, combination allowed"
      },
      "expected_error": null,
      "expected_result": {
        "title": "Compare this expected subtotal with the cart",
        "summary": "Apply the product reduction first. Both order percentages use that revised subtotal, rather than discounting sequentially.",
        "records": [
          [
            "Subtotal before discounts",
            100
          ],
          [
            "Product reduction",
            20
          ],
          [
            "Subtotal used for both order percentages",
            80
          ],
          [
            "Combined order reduction",
            24
          ],
          [
            "Expected subtotal before shipping/tax",
            56
          ]
        ],
        "note": "Declared arithmetic only. Eligibility, Shopify Plus same-line product rules, allocation rounding, app behavior, shipping and tax are not inferred."
      },
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    },
    {
      "brand_id": "saidmaybe",
      "case_id": "percentages-not-sequential",
      "inputs": {
        "subtotal": 100,
        "product": 0,
        "orderA": 10,
        "orderB": 20,
        "scope": "Native, combination allowed"
      },
      "expected_error": null,
      "expected_result": {
        "title": "Compare this expected subtotal with the cart",
        "summary": "Apply the product reduction first. Both order percentages use that revised subtotal, rather than discounting sequentially.",
        "records": [
          [
            "Subtotal before discounts",
            100
          ],
          [
            "Product reduction",
            0
          ],
          [
            "Subtotal used for both order percentages",
            100
          ],
          [
            "Combined order reduction",
            30
          ],
          [
            "Expected subtotal before shipping/tax",
            70
          ]
        ],
        "note": "Declared arithmetic only. Eligibility, Shopify Plus same-line product rules, allocation rounding, app behavior, shipping and tax are not inferred."
      },
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    },
    {
      "brand_id": "saidmaybe",
      "case_id": "app-scope-unknown",
      "inputs": {
        "subtotal": 100,
        "product": 20,
        "orderA": 10,
        "orderB": 20,
        "scope": "App or setting unknown"
      },
      "expected_error": null,
      "expected_result": {
        "title": "Keep the checkout test open",
        "summary": "Do not apply native combination arithmetic to an unknown app or account setting.",
        "records": [
          [
            "Declared subtotal",
            100
          ],
          [
            "Unresolved scope",
            "App or setting unknown"
          ]
        ],
        "note": "This tool does not choose the best discount or inspect a checkout."
      },
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    },
    {
      "brand_id": "saidmaybe",
      "case_id": "invalid-savings",
      "inputs": {
        "subtotal": 100,
        "product": 20,
        "orderA": 101,
        "orderB": 20,
        "scope": "Native, combination allowed"
      },
      "expected_error": "Use valid reductions that do not exceed the declared subtotal.",
      "expected_result": null,
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    },
    {
      "brand_id": "saidmaybe",
      "case_id": "boolean-subtotal-is-not-zero",
      "inputs": {
        "subtotal": false,
        "product": 20,
        "orderA": 10,
        "orderB": 20,
        "scope": "Native, combination allowed"
      },
      "expected_error": "Subtotal needs a numeric value; blank or non-number inputs are not zero.",
      "expected_result": null,
      "scope": "Worked model inputs and expected declared-model behavior, not provider or merchant outcomes."
    }
  ]
}
