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

#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