php - Prestashop $category variable doesn't work within another if -
i use prestashop , need add specific slideshow category->id 1 on top of category's products, , it's need within code below:
i tried insert code:
{if category->id == '1'} ... {/if}
within code:
{if isset($category)} {if $category->id , $category->active} {if $scenes || $category->description || $category->id_image} ... {if $scenes} ... {include file="$tpl_dir./scenes.tpl" scenes=$scenes} {if $category->description} ... {if tools::strlen($category->description) > 350} ... {else} {$category->description} {/if} ... {/if} ... {else} there's tried insert code {/if} {/if} {/if} {/if}
and doesn't work.. why?
regards,
because have placed in wrong position :)
{if isset($category)} {if $category->id , $category->active} {if $scenes || $category->description || $category->id_image} ... {if $scenes} ... {include file="$tpl_dir./scenes.tpl" scenes=$scenes} {if $category->description} ... {if tools::strlen($category->description) > 350} ... {else} {$category->description} {/if} ... {/if} ... {else} there's tried insert code (wrong) {/if} {/if} there's have place code {if $category->id eq 1} /* stuff */ {/if} {/if} {/if}
for next time fix indentation , reach goal ;)
Comments
Post a Comment