How can I echo visual swatch on a phtml Magento 2

1.2k Views Asked by At

I would like to please your help. I want to echo an attribute that I created Brand which is a Visual swatch (i use Ajax Layered Navigation, so I have an option with text and Swatch image). I manage to echo each product the brand text that belongs but I can't echo the image. Can you please help me?

 
 <?php $attributeValue = $_product->getAttributeText('manufacturer'); ?>
       <?php if(strlen($attributeValue) > 0): ?>
       <?php echo $attributeValue; ?>
<?php endif; ?>

0

There are 0 best solutions below