Jump to content

hide product condition if "new"


Recommended Posts

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}
  • Like 2
Link to comment
Share on other sites

 

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

  • 2 months later...

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

×
×
  • Create New...