Jump to content

yasic

Recommended Posts

Hi all,

i'd like to always have the product condition. While 'new' is displayed, also as an option in preferences, but i want to also show if the product is 'used' or 'refurbished'

 

in product list the part where i can change the label should be this:

{if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if}

 

i wonder how to get for example a product.used to work

 

thanks in advance for the help

Link to comment
Share on other sites

Hi.

 

The line you used tells if the product was newly added, it does not refer to the condition.

 

The condition would be: $product.condition

 

Regards.

 

Robin.

 

The CartExpert Team

 

Hi thanks for that. Could you tell me how i would use this to insert on product.tpl to show the actual condition? used, new, refurbished?

Link to comment
Share on other sites

wow that was easy. thanks

but the tricky part is how to i get to 1. change the condition names (i tried in translations, doesnt work) and 2. how to i get it to display in 3 different colors (if i knew where to change the condition name, im sure i could add style into that code)

thanks again

Link to comment
Share on other sites

You helped me a lot already,

im relatively new to php and i dont know how to correctly write these if statements. could you show me an example please? one where i could see how the condition is used (as in "if condition=used", the style and all that i could figure out but the if part is more difficult to me)

thanks

 

 

please pm me a paypal link so that i can tip you for your help.

Link to comment
Share on other sites

Hi.

 

The code would be:

{if $product->condition == 'new'}
<span class="condition_new">{l s='new'}</span>
{elseif $product->condition == 'used'}
<span class="condition_used">{l s='used'}</span>
{else}
<span class="condition_refurbished">{l s='refurbished'}</span>
{/if}

 

Regards.

 

Robin.

 

The CartExpert Team

  • Like 2
Link to comment
Share on other sites

  • 5 months later...

{if $product->condition == 'new'}

<span class="condition_new">{l s='new'}</span>

{elseif $product->condition == 'used'}

<span class="condition_used">{l s='used'}</span>

{else}

<span class="condition_refurbished">{l s='refurbished'}</span>

{/if}

Thank you CartExpert.net

Link to comment
Share on other sites

  • 2 months later...

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