Documentation

Force add Variations to all Product queries

Show Single Variations (SSV) smartly adds variations to all WooCommerce queries like category pages, tag pages, WooCommerce product shortcodes, related products, etc. But if you use a theme that has lots of custom WooCommerce modules, SSV would choose not to add variations to those custom modules by default.

As a solution to this problem, SSV provides a setting to forcefully add variations to all the Product queries on the website (front end only).

When checked, SSV would add variations to all queries that output ‘products’ posts.

How to prevent adding of variations to a specific query?

If you have a custom query where you want to list only the requested products and not all variations, then you can add the iconic_ssv_exclude_variations argument to the list of arguments passed to the WP_Query constructor. Here’s an example:

$args = array(
		'post_type' => 'product',
		'posts_per_page' => 10,
		'iconic_ssv_exclude_variations' => true,
	);

$query = new WP_Query( $args );

Are you using WooCommerce Show Single Variations yet?

Start your 14-day free trial right now and get instant access to the features described in this article.

or learn more

Was this helpful?

Please let us know if this article was useful. It is the best way to ensure our documentation is as helpful as possible.

WooCommerce Show Single Variations

WooCommerce Show Single Variations

Not got the plugin yet? Get instant access right now, free for 14 days.

or learn more

Still need help?

If you haven't found what you're looking for in our documentation, please contact support.

Get Support