Answers for "magento 2 limit product collection"

PHP
2

Limit Product Name in Magento2

<?php
$productName = $_helper->productAttribute($_product, $_product->getName(), 'name');
$len = strlen($productName);
?>
<a class="product-item-link" href="<?php echo /* @escapeNotVerified */ $_product->getProductUrl() ?>">
    <?php echo substr($productName,0,50); ?>
    <?php if($len > 50) echo '...'; ?>
</a>
Posted by: Guest on August-24-2021

Code answers related to "magento 2 limit product collection"

Browse Popular Code Answers by Language