Jump to content

View short description only if it is filled in product


simberak

Recommended Posts

Thank you BonPresta,

It works. But there is one little problem. It displays the code bellow (which I dont want to) even when there are nothing in short description. If there is nothing, it will pass there "space" - so it will appear at FO :(

Is there an option to force stop including space in FO when the short category is empty?

 

The code:

{if isset($product.description_short) && $product.description_short}
  <a class="muj-short-desc" href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" rel="nofollow"  itemprop="url" style="color: white;font-size: 15px; height: 100%; border: 1px; text-align: center; line-height: 20px; padding: 0; float: none; display:block; width: 100%!important; margin: 0px auto; ; padding:15px; background-color: initial; ">
          <div style="background-color: rgb(43,187,216); background-color: rgba(43,187,216,0.8); padding: 5px 0px 5px 0px;">{$product.description_short}</div>
  </a>
{/if}

In FO:

<a class="muj-short-desc" href="http://test.mazlimese.cz/ocelove-sperky-nausnice-z-chirurgicke-oceli/10976-nausnice-tribal-esh41-steel.html" title="Naušnice Tribal ESH41 steel" rel="nofollow" itemprop="url" style="color: white;font-size: 15px; height: 100%; border: 1px; text-align: center; line-height: 20px; padding: 0; float: none; display:block; width: 100%!important; margin: 0px auto; ; padding:15px; background-color: initial; ">
   <div style="background-color: rgb(43,187,216); background-color: rgba(43,187,216,0.8); padding: 5px 0px 5px 0px;"> </div>
</a>

Thank you very much for help,

 

Daniel

Link to comment
Share on other sites

I think the problem is the code {$product.description_short} fills a space if the product doesnt have a short description filled. Is it normal? How then I can achieve to not display short description at products which doesnt have it? :(

 

Thank you for help...

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