function fn_seo_update_product_feature_post(&$feature_data, &$feature_id, &$deleted_variants, &$lang_code) { if ($feature_data['feature_type'] == 'E' && !empty($feature_data['variants'])) { if (!empty($feature_data['variants'])) { foreach ($feature_data['variants'] as $v) { if (!empty($v['variant_id'])) { if (!empty($feature_data['company_id'])) { $v['company_id'] = $feature_data['company_id']; } fn_seo_update_object($v, $v['variant_id'], 'e', $lang_code); } } } if (!empty($deleted_variants)) { db_query("DELETE FROM ?:seo_names WHERE object_id IN (?n) AND type = ?s AND dispatch = '' ?p", $deleted_variants, 'e', fn_get_seo_company_condition('?:seo_names.company_id')); } } elseif (!empty($feature_data['variants']) && is_array($feature_data['variants'])) { $object_ids = array(); foreach ($feature_data['variants'] as $variant) { if (!empty($variant['variant_id'])) { $object_ids[] = $variant['variant_id']; } } db_query("DELETE FROM ?:seo_names WHERE object_id IN (?n) AND type = ?s AND dispatch = '' ?p", $object_ids, 'e', fn_get_seo_company_condition('?:seo_names.company_id')); } }
function fn_seo_update_news(&$news_data, &$news_id, &$lang_code) { if (!empty($news_data['news']) && !empty($news_id)) { if (Registry::get('runtime.company_id')) { $news_data['company_id'] = Registry::get('runtime.company_id'); } fn_seo_update_object($news_data, $news_id, 'n', $lang_code); } }