# fluent-cart/1.6.4/app/Modules/ProductIntegration/ProductIntegrationHandler.php

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

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Modules/ProductIntegration/ProductIntegrationHandler.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Modules/ProductIntegration/ProductIntegrationHandler.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/Modules/ProductIntegration/ProductIntegrationHandler.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Modules\ProductIntegration;

use FluentCart\App\Models\ProductMeta;
use FluentCart\App\Modules\Integrations\GlobalIntegrationSettings;
use FluentCart\App\Modules\Integrations\GlobalNotificationHandler;
use FluentCart\Framework\Support\Arr;

class ProductIntegrationHandler
{
    public function handle($order, $customer, $targetHook, $group): void
    {
        if (empty($order->order_items)) {
            return;
        }

        $productIds = $order->order_items->pluck('post_id');
        $productFeeds = $this->getProductsFeeds($productIds);

        $formattedFeeds = (new GlobalIntegrationSettings())->formatFeedsData($productFeeds);

        (new GlobalNotificationHandler())->triggerNotification(
            $formattedFeeds,
            $order,
            $customer,
            $targetHook,
            $group,
            'product_integration'
        );
    }

    public function getProductsFeeds($productIds)
    {
        return ProductMeta::query()->where('object_type', 'product_integration')
            ->whereIn('object_id', $productIds)
            ->get();
    }

}

```
