# fluent-cart/1.6.4/app/Events/PlanChanged.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 53 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Events/PlanChanged.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Events/PlanChanged.php
- Modified: 2025-10-14T16:36:46+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.4/code/app/Events/PlanChanged.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Events;

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

class PlanChanged extends EventDispatcher
{

    public string $hook = 'fluent_cart/plan_changed';
    protected array $listeners = [];

    public Order $order;
    public ProductVariation $newVariation;
    public ProductVariation $oldVariation;
    public array $otherInfo = [];


    public function __construct(Order $order, ProductVariation $newVariation, ProductVariation $oldVariation, $otherInfo = null)
    {
        $this->order = $order;
        $this->newVariation = $newVariation;
        $this->oldVariation = $oldVariation;
        $this->otherInfo = is_array($otherInfo) ? $otherInfo : [];

        // Load necessary relationships
        $this->order->load('customer', 'shipping_address', 'billing_address');
    }

    public function toArray(): array
    {
        return [
            'order' => $this->order->toArray(),
            'customer' => $this->order->customer ? $this->order->customer->toArray() : [],
            'new_variation' => $this->newVariation->toArray(),
            'old_variation' => $this->oldVariation->toArray(),
            'other_info' => $this->otherInfo
        ];
    }

    public function getActivityEventModel()
    {
        return null;
    }

    public function shouldCreateActivity(): bool
    {
        return false;
    }
}
```
