Feature: Creating Cart Service, Cart Events, Save For Later functionality, Adding Filament Views for viewing abandoned carts
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Cart\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
/**
|
||||
* Thrown by CartService::applyCoupon() when the given code doesn't match any
|
||||
* currently-active, non-exhausted Discount — Lunar's own
|
||||
* Discounts::validateCoupon() only returns a bool, it has no matching
|
||||
* exception type of its own to reuse here.
|
||||
*/
|
||||
class InvalidCouponException extends RuntimeException
|
||||
{
|
||||
public function __construct(public readonly string $code)
|
||||
{
|
||||
parent::__construct("The coupon code \"{$code}\" is not valid.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user