Jump to content

If short description is missing, use desc in product-list


watheris

Recommended Posts

Hi watheris,

 

- What PrestaShop version do you use?

- Default theme?

 

 

if 1.5, try this:

 

edit file: themes/<your theme folder>/product-list.tpl (make backup!)

 

and find the following line (search for '_short' to find it easily)

 

                <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
 

 

 

change to something ike:

 

                <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{if $product.description_short}{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}{else}{$product.description|strip_tags:'UTF-8'|truncate:360:'...'}{/if}" >{if $product.description_short}{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}{else}{$product.description|strip_tags:'UTF-8'|truncate:360:'...'}{/if}}</a></p>
 

 

if 1.6.x, try this:

 

Edit same file as above (make backup!)

 

 

find this code (search for '_short' again to find it easily):

 

                    <p class="product-desc" itemprop="description">
                        {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
                    </p>

 

 

change to:

 

                    <p class="product-desc" itemprop="description">
                        {if $product.description_short}{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}{else}{$product.description|strip_tags:'UTF-8'|truncate:360:'...'}{/if}
                    </p>

 

Didn't test it, but give it a shot.

 

pascal.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...