<?php

namespace Opencart\Catalog\Controller\Extension\Alsendo\Event;

class ShippingExtension extends \Opencart\System\Engine\Controller
{
    public function filterShippingExtensions(&$route, &$args, &$output)
    {
        $type = $args[0] ?? null;

        if ($type !== 'shipping') {
            return;
        }

        // Work-around to treat the Alsendo extension as shipment, despite being a "module"
        $query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "extension` WHERE `type` = 'module' AND `extension` = 'alsendo'");

        $output = array_merge($output, $query->rows);
    }
}