# fluent-cart/1.6.5/app/Events/Order/OrderDeleted.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.5. 56 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.5/code/app/Events/Order/OrderDeleted.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.5/raw/app/Events/Order/OrderDeleted.php
- Modified: 2026-06-11T12:21:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-cart/1.6.5/code/app/Events/Order/OrderDeleted.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Events\Order;

use FluentCart\App\Events\EventDispatcher;
use FluentCart\App\Listeners;
use FluentCart\App\Models\Customer;
use FluentCart\App\Models\Order;

class OrderDeleted extends EventDispatcher
{
    public string $hook = 'fluent_cart/order_deleted';

    protected array $listeners = [
        // Listeners\UpdateStock::class,
        Listeners\Order\OrderDeleted::class
    ];

    /**
     * @var Order $order
     */
    public Order $order;

    /**
     * @var Customer|null $customer
     */

    public array $connectedOrderIds;

    public function __construct(Order $order, $connectedOrderIds = [])
    {
        $this->order = $order;
        $this->connectedOrderIds = $connectedOrderIds ?? [];
        $this->order->loadMissing('customer', 'shipping_address', 'billing_address');
    }

    public function toArray(): array
    {
        return [
            'order' => $this->order,
            'customer' => $this->order->customer ?? [],
            'connected_order_ids' => $this->connectedOrderIds
        ];
    }

    public function getActivityEventModel()
    {
        return $this->order;
    }

    public function shouldCreateActivity(): bool
    {
        return $this->order->mode !== \FluentCart\App\Helpers\Status::ORDER_MODE_TEST;
    }
}

```
