Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]
  • Loading branch information
lukepolo authored and StyleCIBot committed Jan 27, 2018
1 parent 24e937f commit c15ed9c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ public function addCoupon(CouponContract $coupon)
$this->code = $coupon->code;
$this->couponInfo = $coupon->options;
$this->discount = $coupon->forItem($this);

return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Coupons/Percentage.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public function __construct($code, $value, $options = [])
*/
public function forItem(CartItem $item)
{
if(config('laracart.tax_item_before_discount')) {
return $item->subTotal(false, false, false , true) * $this->value;
if (config('laracart.tax_item_before_discount')) {
return $item->subTotal(false, false, false, true) * $this->value;
}

return $item->price * $this->value;
Expand Down
2 changes: 1 addition & 1 deletion src/LaraCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ public function subTotal($format = true, $withDiscount = true)
}
}

if($total < 0) {
if ($total < 0) {
$total = 0;
}

Expand Down

0 comments on commit c15ed9c

Please sign in to comment.