Override Function

Please Help me
how to achieve this I want to override this
This is how I call the function
list($product_features, $features_search) = fn_get_paginated_product_features($_REQUEST, $auth, );
Tygh::$app[‘view’]->assign(‘product_features’, $product_features);

that functions chain this method down to fn_get_product_feature_variants
app\functions\fn.common.php
app\functions\fn.features.php
app\functions\fn.features.php
fn_get_paginated_product_features → fn_get_product_features → fn_get_product_feature_variants

the Goal is to override this query on fn_get_product_feature_variants

$vars = db_get_hash_array(‘SELECT ’ . implode(’, ', $fields) . " FROM ?:product_feature_variants $join WHERE 1 $condition $group_by ORDER BY $sorting $limit", ‘variant_id’);

to

new columns ?:product_feature_variant_descriptions.status = ‘A’

$vars = db_get_hash_array(‘SELECT ’ . implode(’, ', $fields) . " FROM ?:product_feature_variants $join WHERE 1 $condition $group_by AND ?:product_feature_variant_descriptions.status = ‘A’ ORDER BY $sorting $limit", ‘variant_id’);

this works on main function my goal is to override the query on my add on function

Thanks

You can use the get_product_feature_variants hook to add extra condition to the $condition variable

Hi @ecomlabs this is this what you are referring? fn_set_hook(‘get_product_feature_variants’, $fields, $join, $condition, $group_by, $sorting, $lang_code, $limit, $params); should i call this method directly on my func.php?

Please check the following article

https://docs.cs-cart.com/latest/developer_guide/core/coding_standards/hooks.html#php-hooks-and-functions