use Tygh\Registry; use Tygh\Ym\Yml2; use Tygh\Enum\ProductFeatures; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update_offers') { if (!empty($_REQUEST['data']['ym_features'])) { fn_yml_update_offers_features($_REQUEST['data']['ym_features']); } $suffix = '.offers_params'; } elseif ($mode == 'update') { $price_id = $_REQUEST['price_id']; if (!empty($_REQUEST['pricelist_data'])) { $price_id = fn_yml_update_price_list($price_id, $_REQUEST['pricelist_data']); } $suffix = ".update?price_id=" . $price_id; } elseif ($mode == 'delete_price_list') { fn_yml_delete_price_lists(array($_REQUEST['price_id'])); $suffix = '.manage'; } elseif ($mode == 'm_delete_price_lists') { if (!empty($_REQUEST['price_ids'])) { fn_yml_delete_price_lists($_REQUEST['price_ids']); } $suffix = '.manage'; } elseif ($mode == 'stop_generate') { $price_id = $_REQUEST['price_id']; fn_yml_stop_generate($price_id); $suffix = ".manage"; }
function fn_yml_update_categories_price_lists() { $price_lists = fn_yml_get_price_lists(); foreach ($price_lists as $param_id => $param) { fn_yml_update_price_list($param_id, $param['param_data']); } }