I want to check whether a product exists within a specific category and if true show message.
At the moment I am having to do this via strpos using the Name attribute value.
<?php if (strpos($_product->getName(),"Hello") !==false): ?>
<div style="margin-bottom:10px;">
<p><i style="font-style:italic;">A message goes here.</i></p>
</div>
<?php endif; ?>
Is there any way to do similar using either category name or ID?