# fluent-cart/1.5.4/app/Events/ProductVariationsChanged.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.5.4. 50 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.5.4/code/app/Events/ProductVariationsChanged.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.5.4/raw/app/Events/ProductVariationsChanged.php
- Modified: 2026-06-23T13:53:00+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.5.4/code/app/Events/ProductVariationsChanged.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Events;

use FluentCart\App\Listeners\UpdateDefaultVariation;

/**
 * Fired when a product's variation set changes in a way that can invalidate its
 * default_variation_id — combinations regenerated/removed, or a variant set
 * active/inactive. Distinct from StockChanged (which is broad and currently
 * carries no default listener) so this stays scoped to variant-set mutations.
 * UpdateDefaultVariation re-resolves the default to the first purchasable
 * combination; works for every variation type.
 */
class ProductVariationsChanged extends EventDispatcher
{
    public string $hook = 'fluent_cart/product_variations_changed';

    protected array $listeners = [
        UpdateDefaultVariation::class,
    ];

    /**
     * @var array $postIds
     */
    public $postIds;

    public function __construct($postIds)
    {
        $this->postIds = $postIds;
    }

    public function toArray(): array
    {
        return [
            'post_ids' => $this->postIds,
        ];
    }

    public function getActivityEventModel()
    {
        return null;
    }

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

```
