Same issue with magento 2.2.2.
When you create a cart rule and you select Subtotal as cart attribute condition you are choosing the html option value value="Magento\SalesRule\Model\Rule\Condition\Address|base_subtotal"
.
It means that the cart rule will use the quote_address.base_subtotal
column to validate the coupon's condition.
If your catalog has the Catalog Prices option (Stores->Configuration->Sales->Tax->Calculation Settings) setted to Excluding Tax the quote_address.base_subtotal
will contain subtotal WITHOUT tax.
Now, digging in the magento core i found that the cart rule condition is validated in vendor/magento/module-rule/Model/Condition/AbstractCondition.php
with validate()
method.
To fix the issue, i changed the code in
...
$attr = $this->getAttribute();
if ($attr == "base_subtotal") $attr = "base_subtotal_total_incl_tax";
$attributeValue = $model->getData($attr);
return $this->validateAttribute($attributeValue);
...
so, quote_address.base_subtotal_total_incl_tax
will be used instead of quote_address.base_subtotal
.
PS1: i also tried a lot on the web to find a solution and i did not find anything
PS2: i changed and suggested how to fix the issue directly in the core file, but it is a bad pratice, take your precautions :)