I wanted to follow up with more information:
We’ve found that the price change happens before our app’s Discount Function is executed. The invocation 9b65266b-b8e7-408e-b3dd-a171cb51dd5d
demonstrates the item’s amountPerQuantity
has already been changed to 33.33
(the original price is 40
) by the time the discount calculation happens. I’ve attached the input data:
{
"cart": {
"buyerIdentity": null,
"lines": [
{
"id": "gid://shopify/CartLine/0",
"quantity": 1,
"cost": {
"amountPerQuantity": {
"amount": "33.33"
},
"compareAtAmountPerQuantity": null
},
"merchandise": {
"__typename": "ProductVariant",
"id": "gid://shopify/ProductVariant/51286840148296",
"product": {
"id": "gid://shopify/Product/9650913116488",
"inCollections": [],
"hasTags": [],
"vendor": "(Vendor name redacted)"
}
},
"sellingPlanAllocation": null
}
]
},
"discountNode": {
"metafield": {
"jsonValue": {
"message": "",
"isEnabled": true,
"customLogic": {
"id": "<root>",
"type": "ROOT",
"entryPoint": {
"id": "entrypoint",
"type": "CHECK_IF",
"matchType": "AND",
"conditions": [
{
"type": "PRODUCT_ELIGIBILITY",
"includeOrExclude": "INCLUDE",
"eligibility": {
"type": "SPECIFIC_PRODUCTS",
"selectedProducts": [],
"asListOfIds": "9650913116488"
}
}
],
"then": {
"id": "check-if730",
"type": "CHECK_IF",
"matchType": "AND",
"then": {
"id": "entrypoint-then-apply-discount",
"type": "APPLY_DISCOUNT",
"title": "BIRETIX Double Correction Serum Free Trial",
"value": {
"type": "PERCENTAGE",
"percentage": "100"
},
"dimensions": {
"width": 332,
"height": 308
},
"position": {
"x": 943.4493210454646,
"y": -9.052053023566032
}
},
"otherwise": null,
"conditions": [
{
"type": "PURCHASE_REQUIREMENTS",
"minOrMax": "MAX",
"requirements": {
"requirementType": "QUANTITY",
"quantity": "1",
"subtotal": "0",
"appliesTo": "ELIGIBLE_LINE_ITEMS"
}
}
],
"position": {
"x": 611.4493210454646,
"y": -9.052053023566032
},
"dimensions": {
"width": 261,
"height": 160
},
"tooltips": {}
},
"otherwise": null,
"tooltips": {},
"dimensions": {
"width": 292,
"height": 180
},
"position": {
"x": 246,
"y": 0
}
},
"dimensions": {
"width": 150,
"height": 0
},
"position": {
"x": 0,
"y": 0
}
},
"customerEligibility": {
"type": "ALL_CUSTOMERS"
},
"productEligibility": {
"type": "ALL_PRODUCTS"
},
"developerOptions": {
"alwaysThrow": false
},
"minimumPurchaseRequirements": {
"requirementType": "NONE",
"quantity": "0",
"subtotal": "0",
"appliesTo": "ELIGIBLE_LINE_ITEMS"
},
"maximumPurchaseRequirements": {
"requirementType": "NONE",
"quantity": "0",
"subtotal": "0",
"appliesTo": "ELIGIBLE_LINE_ITEMS"
},
"value": {
"type": "PERCENTAGE",
"percentage": "0"
},
"appliesToSellingPlans": "ALL_SELLING_PLANS",
"salePriceHandlingStrategy": "APPLY_TO_COMPARE_AT_PRICE",
"cartLineSortOrder": "HIGHEST_PRICED_PRODUCTS"
}
}
},
"localization": {
"country": {
"isoCode": "GB"
},
"market": {
"id": "gid://shopify/Market/78743306568"
}
},
"presentmentCurrencyRate": "1.0"
}