You can embed a shortcode in a custom shortcode with the needed conditional logic:
add_shortcode( 'my_wheel', 'custom_conditional_wof_wheel' );
function custom_conditional_wof_wheel( $atts ){
$atts = shortcode_atts( array(
'id' => '',
'count' => '4', // 4 cart items by default
), $atts, 'my_wheel' );
// If there is more than 4 items count in cart the shortcode [wof_wheel] is executed
if( WC()->cart->get_cart_contents_count() > $atts['count'] ){
$id = $atts['id'];
return do_shortcode( "[wof_wheel id='$id']" );
}
// Else it display nothing
return '';
}
Code goes in function.php file of your active child theme (active theme). tested and works.
(see at the end how I have tested that).
USAGE:
1) For more than 4 items in cart (4 items is set by default in the shortcode):
[my_wheel id="1111"]
2) For more than 6 items in cart for example:
[my_wheel id="1111" count='6']
How this has been tested.
As I can't test this shortcode that comes from a specific third party plugin, I have created a [my_wheel] shortcode that will output the ID provided in the shortcode argument id:
add_shortcode( 'my_wheel', 'custom_conditional_wof_wheel' );
function custom_conditional_wof_wheel( $atts ){
$atts = shortcode_atts( array(
'id' => '',
'count' => 4,
), $atts, 'my_wheel' );
if( WC()->cart->get_cart_contents_count() > $atts['count'] ){
$id = $atts['id'];
return do_shortcode( "[wof_wheel id='$id']" );
}
return '';
}
Code goes in function.php file of your active child theme (active theme).
Then I have added [my_wheel id="1111"] shortcode in the Wordpress text editor of a page and I get this display when the cart items count is 5 or more:

So it works.