We encounter the similar issue with more complex condition, it looks like the bug was half fixed, but not entirely fixed . The “excludedVariantIds” was successfully applied for “orderMinimumSubtotal” in the condition logic in my case, but only for store default currency (which is USD in our case). In our case, we applied 4 currencies: USD, CAD, AUD, and NZD. The USD works well, but other currencies causing some problems.
Our discount logic:
const thresholds = {
"USD": [ 89, 149, 249 ],
"CAD": [ 119, 199, 339 ],
"AUD": [ 129, 219, 369 ],
"NZD": [ 139, 239, 399 ]
}
const discounts = [
// first tier discount
{
value: {
percentage: {
value: 15,
},
},
conditions: [
{
orderMinimumSubtotal: {
targetType: TargetType.OrderSubtotal,
minimumAmount: thresholds[currencyCode][0],
excludedVariantIds: excludedVariantIds,
},
},
],
targets: [
{
orderSubtotal: {
excludedVariantIds: excludedVariantIds,
},
},
],
},
// seconnd tier discount
{
value: {
percentage: {
value: 25,
},
},
conditions: [
{
orderMinimumSubtotal: {
targetType: TargetType.OrderSubtotal,
minimumAmount: thresholds[currencyCode][1],
excludedVariantIds: excludedVariantIds,
},
},
],
targets: [
{
orderSubtotal: {
excludedVariantIds: excludedVariantIds,
},
},
],
},
// third tier discount
{
value: {
percentage: {
value: 40,
},
},
conditions: [
{
orderMinimumSubtotal: {
targetType: TargetType.OrderSubtotal,
minimumAmount: thresholds[currencyCode][2],
excludedVariantIds: excludedVariantIds,
},
},
],
targets: [
{
orderSubtotal: {
excludedVariantIds: excludedVariantIds,
},
},
],
}
]
// return tier discount;
return {
discounts: discounts,
discountApplicationStrategy: DiscountApplicationStrategy.Maximum
}
We did a huge amount of test, and found that there might be two conditions taking effect at the same time.
First condition (which is exactly what the code above shows) :
Order subtotal (excluding the variantIds we expected) meets the minimum amount we set, for whatever currency provided by the cart object. (Which is perfectly correct. This is what we want! )
Second condition ( not implemented by our code at all, but taking effect at the same time, we suspect it is the old logic in Shopify ) :
Order subtotal (doesn’t excluding the variantIds we expected) meets the minimum amount we set, ignores the currency (it supposes the currency is “USD”, not taking cart currency info into consideration), and only works for the first tier (looks like the “discountApplicationStrategy: DiscountApplicationStrategy.Maximum” is not taking effect for this logic as well).
The second condition causing issues when our store switched to other currency, since the condition was still calculated in “USD”, and it doesn’t exclude the variantIds we specified, and it somehow only apply first tier. (This is very likely matching the logic in the old code.)
So we highly suspected that the bug was fixed by adding new code, but didn’t remove the old code. For the store with only one currency, the problem looks fixed. But for multiple currencies situation, the problem stay there.
Please check with the technical person to confirm whether this bug exists or not, as this affect our business strategies. (And we are in Shopify Plus plan)