If Entry is related to Category-A, then print xyz
All you need to do is this in the product for Loop

{% if product.category.first.slug == 'brandx' %}
    Brand X
{% endif %}


Or Shorthand 

{{ product.category.first.slug == 'brandx' ? 'Brand X' }}  


Not tested but thats the gist of it.

--Edited