simberak Posted August 18, 2017 Share Posted August 18, 2017 (edited) Hello, could you please help me with code so the {$product.description_short} will apper in FO only if the product have it? It is the conditioning with "if" but I am not programmer. Thank you VERY much, Daniel Edited August 23, 2017 by simberak (see edit history) Link to comment Share on other sites More sharing options...
BonPresta Posted August 18, 2017 Share Posted August 18, 2017 Hello, {if isset($product.description_short) && $product.description_short} {$product.description_short} {/if} 1 Link to comment Share on other sites More sharing options...
simberak Posted August 21, 2017 Author Share Posted August 21, 2017 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 More sharing options...
simberak Posted August 22, 2017 Author Share Posted August 22, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now