alfredopacino Posted April 4, 2014 Share Posted April 4, 2014 can i do that? i want to hide the product condition field in product page if it is set in default value "new". Link to comment Share on other sites More sharing options...
vekia Posted April 4, 2014 Share Posted April 4, 2014 and if product condition is different, you want to display it as it is displayed right now? Link to comment Share on other sites More sharing options...
alfredopacino Posted April 4, 2014 Author Share Posted April 4, 2014 and if product condition is different, you want to display it as it is displayed right now? yep Link to comment Share on other sites More sharing options...
vekia Posted April 4, 2014 Share Posted April 4, 2014 ok, so soultion is easy open template file: product.tpl there is a code like: {capture name=condition} {if $product->condition == 'new'}{l s='New'} {elseif $product->condition == 'used'}{l s='Used'} {elseif $product->condition == 'refurbished'}{l s='Refurbished'} {/if} {/capture} change it to: {capture name=condition} {if $product->condition == 'new'} {elseif $product->condition == 'used'}{l s='Used'} {elseif $product->condition == 'refurbished'}{l s='Refurbished'} {/if} {/capture} i just removed the {l s='New'} then change: <label>{l s='Condition'} </label> to: {if $product->condition != 'new'}<label>{l s='Condition'} </label>{/if} 2 Link to comment Share on other sites More sharing options...
alfredopacino Posted April 4, 2014 Author Share Posted April 4, 2014 (edited) thanks can you link me some documentation for this kind of script? Edited April 4, 2014 by alfredopacino (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted April 4, 2014 Share Posted April 4, 2014 you're reffering to smarty... or? or what? Link to comment Share on other sites More sharing options...
alfredopacino Posted April 4, 2014 Author Share Posted April 4, 2014 you're reffering to smarty... or? or what? all the scripts contained in tpl files.. Link to comment Share on other sites More sharing options...
roz Posted April 5, 2014 Share Posted April 5, 2014 hi. if i want to totally remove this from being shown should i just remove that chunk of code? Link to comment Share on other sites More sharing options...
peanut Posted April 5, 2014 Share Posted April 5, 2014 ok, so soultion is easy open template file: product.tpl there is a code like: {capture name=condition} {if $product->condition == 'new'}{l s='New'} {elseif $product->condition == 'used'}{l s='Used'} {elseif $product->condition == 'refurbished'}{l s='Refurbished'} {/if} {/capture} change it to: {capture name=condition} {if $product->condition == 'new'} {elseif $product->condition == 'used'}{l s='Used'} {elseif $product->condition == 'refurbished'}{l s='Refurbished'} {/if} {/capture} i just removed the {l s='New'} then change: <label>{l s='Condition'} </label> to: {if $product->condition != 'new'}<label>{l s='Condition'} </label>{/if} thanks! this is exactly what I needed... Link to comment Share on other sites More sharing options...
vekia Posted April 5, 2014 Share Posted April 5, 2014 hi. if i want to totally remove this from being shown should i just remove that chunk of code? :)s yesss if you want to remove whole "condition" (no matter what condition you selected) based on: remove product conditions prestashop 1.6 2 Link to comment Share on other sites More sharing options...
roz Posted April 7, 2014 Share Posted April 7, 2014 yesss if you want to remove whole "condition" (no matter what condition you selected) based on: remove product conditions prestashop 1.6 thanks vekia! done! Link to comment Share on other sites More sharing options...
KaulanaPet Posted July 4, 2014 Share Posted July 4, 2014 product.tpl changed in ver 1.6.0.8 ... This fix doesn't work anymore Link to comment Share on other sites More sharing options...
vekia Posted July 4, 2014 Share Posted July 4, 2014 indeed prestashop 1.6.0.8 displays it in a different way anyway it's still easy to modify {if $product->condition} <p id="product_condition"> <label>{l s='Condition'} </label> {if $product->condition == 'new'} <link itemprop="itemCondition" href="http://schema.org/NewCondition"/> <span class="editable">{l s='New'}</span> {elseif $product->condition == 'used'} <link itemprop="itemCondition" href="http://schema.org/UsedCondition"/> <span class="editable">{l s='Used'}</span> {elseif $product->condition == 'refurbished'} <link itemprop="itemCondition" href="http://schema.org/RefurbishedCondition"/> <span class="editable">{l s='Refurbished'}</span> {/if} </p> {/if} Link to comment Share on other sites More sharing options...
Recommended Posts