在2行上创建prestashop 1.7名称和描述

everyone!

I need to make the name and description in the product miniatures on 2 lines. So what I did was, I changed templates\catalog_partials\miniatures\product.tpl like so:

        {block name='product_name'}
          <h3 itemprop="name"><a href="{$product.url}" class="product_name">{$product.name|truncate:45:'...'}</a></h3>
          <div class="miniature-description" id="miniature-description">{$product.description_short|truncate:45:''|escape:'html':'UTF-8' nofilter}</div>
          {if $product.description_short == ' '}
          <div class="miniature-description-2">{$product.description|truncate:45:''|escape:'html':'UTF-8' nofilter}</div>

          {/if}
        {/block}

This works to some degree, but I want it to always show the first 2 lines no matter how long the description is.

If someone can tell me what I can do to make it work, I would be really grateful.

First of all, I don't recommend you to use truncate for description. It can contain HTML data and it's a huge probability that you will truncate it in an inappropriate place and you will lose HTML tags. What about your goal, I think that it isn't possible at all if consider it like a reliable approach. Because you can have any description and you never know what it contains. But if you want it exceptionally for your site you can add some conditional mark to all descriptions and explode them by it. For example

{assign var="desc" value="your_conditional_mark_here"|explode:$product.description}
{$desc[0]}<!--Part before your mark-->
{$desc[1]}<!--Part after your mark-->

But remember that it still wouldn't be reliable approach