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,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Core\Recovery\Events;
|
||||
|
||||
use Lunar\Models\Cart;
|
||||
|
||||
/**
|
||||
* A cart has gone stale (no activity for config('core.cart.abandoned_after'))
|
||||
* with NO order ever started — the shopper added items and never began
|
||||
* checkout. Weak purchase-intent signal: usually a browsing/price-check
|
||||
* action, not a near-purchase. Distinct from CheckoutAbandoned, which fires
|
||||
* for a cart that DID reach checkout (a draft Order exists) but never placed
|
||||
* it — a much stronger intent signal, and reachable via the email/address
|
||||
* checkout itself usually captures even for a guest.
|
||||
*
|
||||
* Lives under Recovery, not Cart — abandonment detection/tracking is
|
||||
* deliberately kept out of the Cart module entirely, including its event
|
||||
* definitions, so Cart has no abandonment-related code at all. See
|
||||
* docs/cart.md and docs/recovery-strategies.md.
|
||||
*
|
||||
* "Abandoned" is a derived state (stale updated_at), not something that
|
||||
* transitions via a normal Eloquent write, so there's no natural model-event
|
||||
* hook to dispatch this from directly — detection is Recovery's own concern
|
||||
* (not yet built; design notes in docs/recovery-strategies.md).
|
||||
*/
|
||||
class CartAbandoned
|
||||
{
|
||||
public function __construct(
|
||||
public readonly Cart $cart,
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user