Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>
Comment

PREVIOUS NEXT
Code Example
Php :: is php the fucking worst 
Php :: laravel get next record 
Php :: Your Composer dependencies require the following PHP extensions to be installed: curl 
Php :: phpspreadsheet edit excel file 
Php :: laravel drop column if exists 
Php :: pdo turn on errors 
Php :: get user avatar wordpress 
Php :: add another field in existing migration laravel 
Php :: seconds to days hours minutes seconds php 
Php :: php repeat string 
Php :: laravel get full url with parameters 
Php :: tolower php 
Php :: wp revisions config 
Php :: relative path php 
Php :: php remove object from array by property 
Php :: php elseif 
Php :: php konstanten 
Php :: laravel maintenance mode 
Php :: pdo get row count 
Php :: how to add title to wordpress php 
Php :: wordpress disable file mods 
Php :: php convert special characters to normal 
Php :: get random data laravel 
Php :: laravel validate max file size 
Php :: laravellivewire is not defined 
Php :: update eloquent with increment laravel 
Php :: how match array in laravel collection 
Php :: php all date formats 
Php :: Creating a new laravelproject 
Php :: laravel created_at where date format 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =