Skip to content

Commit

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

Please sign in to comment.