Skip to content

Commit c1262aa

Browse files
committed
wip
1 parent 0acb0b2 commit c1262aa

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

src/Models/Item.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,12 @@ public function calculateTaxes(): float
330330

331331
return $this->getTaxTotal();
332332
}
333+
334+
/**
335+
* Calculate the discount.
336+
*/
337+
public function calculateDiscount(): float
338+
{
339+
return 0.0;
340+
}
333341
}

src/Models/Shipping.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public function calculateTaxes(): float
320320
{
321321
$this->taxes()->detach();
322322

323-
$taxes = TaxRate::proxy()
323+
TaxRate::proxy()
324324
->newQuery()
325325
->applicableForShipping()
326326
->get()
@@ -331,6 +331,14 @@ public function calculateTaxes(): float
331331
return $this->getTaxTotal();
332332
}
333333

334+
/**
335+
* Calculate the discount.
336+
*/
337+
public function calculateDiscount(): float
338+
{
339+
return 0.0;
340+
}
341+
334342
/**
335343
* Validate the shipping address.
336344
*/

src/Traits/AsOrder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public function applyCoupon(string|Coupon $coupon): bool
414414
} catch (ModelNotFoundException $exception) {
415415
//
416416
} catch (Throwable $exception) {
417-
$this->coupons()->detach([$coupon->getKey()]);
417+
$this->removeCoupon($coupon);
418418
}
419419

420420
return false;

0 commit comments

Comments
 (0)