Home › Forums › WoodMart support forum › REST API and Woodmart Variations As Single Products Setting › Reply To: REST API and Woodmart Variations As Single Products Setting
September 2, 2024 at 9:25 am
#594318
Artem Temos
Keymaster
Hello,
Try to replace the old code with this one
add_action(
'init',
function() {
if ( ! woodmart_get_opt( 'show_single_variation' ) ) {
return;
}
$query = XTS\Modules\Show_Single_Variations\Query::get_instance();
if ( has_action( 'pre_get_posts', array( $query , 'add_variations_to_product_query') ) ) {
remove_action( 'pre_get_posts', array( $query , 'add_variations_to_product_query') );
}
}
);
Kind Regards