Skip to content

Commit

Permalink
Fix the missing discounts.
Browse files Browse the repository at this point in the history
(cherry picked from commit 8443ccd)
  • Loading branch information
richardhj committed Apr 23, 2018
1 parent 1bbcfdc commit a0eb5a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Util/OrderLine.php
Expand Up @@ -171,7 +171,9 @@ public static function createForSurcharge(ProductCollectionSurcharge $surcharge)
$self = new self();
$self->setSurcharge($surcharge);

if ($surcharge instanceof ProductCollectionSurcharge\Rule && 'subtotal' !== $surcharge->applyTo) {
if ($surcharge instanceof ProductCollectionSurcharge\Rule
&& $surcharge->type === 'product'
&& 'subtotal' !== $surcharge->applyTo) {
// In case that the rule applies to the product, we need to alter the $total_discount_amount instead
return null;
}
Expand Down

0 comments on commit a0eb5a2

Please sign in to comment.