<?php

use ModulesGarden\ProxmoxAddon\App\Models\ModuleSetting;

require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'Bootstrap.php';

\ModulesGarden\ProxmoxAddon\Core\Hook\HookManager::create(__DIR__);


/**
 * Support for dupliate product
 */
if($_GET['action']=="duplicatenow" && $_POST['existingproduct'] &&  $_POST['newproductname']){
    try{
        $setting          = new ModuleSetting();
        $setting->setting = "duplicateProduct";
        $setting->value   = json_encode($_POST);
        $setting->save();
    }catch (\Exception $ex){
    }
}
