You can use the same approach as the link provided in your question. Only, instead of an entry, you're working with a product.
For example:
template.twig
{# Get the current section - set fallback(s) for entries or products or ?? #}
{% set section = entry.getSection() | default(entry.getSection() ?? product.getType() ?? null) %}
{% if section %}
{% set handle = section.handle %}
{{ handle }} {# myProductType #}
{% endif %}
Here we are checking if we're on an entry. If not, we've set a fallback to check if we're on a product page. If nothing, the we return null.
Once we've got our section, we can check the handle. Then it's a matter of checking for the type you are looking for.
...
{% if handle == 'myHandle' %}
<p>We've got a winner!</p>
{% endif %}