Skip to content

How to print custom attribute on Product listing page?

my catalog_category_view.xml

</body>

my custom_attribte.phtml

getProduct();
$attrData = $product->getData(‘feature’);
$blockTitle = $this->getData(‘title’);
if ($attrData !== “”) : ?>

<div class="product-full-width-section">
    <h2 class="product-section-title"><?= $blockTitle; ?></h2>
    <?php echo $attrData; ?>
</div>