Jump to content

Show product condition if "refurbished"


Recommended Posts

Hello, I need your help. I've got a pretashop  site that sales new and refurbished products, on product.tpl i added the code

"{block name='product_condition'}
    <br></br><span style="color: #339966; font-size: 16px">
    {if $product.condition}
      <div class="product-condition">
        <label class="label">{l s='Condition' d='Shop.Theme.Catalog'} </label>
        <link itemprop="itemCondition" href="{$product.condition.schema_url}"/>

, but what I really want is to only show condition of the product if it's refurbished, and not of all of them, since I've got more then 50.000 products, and I import via CSV, I can't "untick" each new product do hide the condition. I think I just need an "if" in that code to show only refurbished products.


Best regards

Link to comment
Share on other sites

41 minutes ago, musicmaster said:

Try {$product.condition AND ($product.condition != "new")}

Hello, thank you, for helping

If I replace  {if $product.condition} with {$product.condition AND ($product.condition != "new")} I get this: it just adds "1"  on "New" and on "refurbished" products


Link to comment
Share on other sites

14 hours ago, musicmaster said:

This requires a bit creativity from your side. If it can display "1" it can also display "refurbished". Just replace the text that produces "1" with the plain text "refurbished".

it displays "1" for both new and refurbished, I think it should display diferente values for each condition.

Link to comment
Share on other sites

42 minutes ago, musicmaster said:

You can with {$product|print_r} as debug code see what the product object contains. This is as far as I can help you. I would have to charge for investigating the details of your site.

ok, thank you, i'll try to figure out a way to do this. thank you for your help.

Link to comment
Share on other sites

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