Test for specific or multiple product variants
product.variants|length will in fact give you the exact number of variants the product has. If it is giving you an unexpected response, you’re probably just not looking at the right product in the first place. Try outputting the following to create a URL to the product’s edit page in the Control Panel:

&lt;a href="{{ product.getCpEditUrl() }}"&gt;{{ product.title }}&lt;/a&gt;


Then click on that link from your browser to see the actual product you’re dealing with.