NunoACruz Posted September 6, 2021 Share Posted September 6, 2021 Hello, I need your help. I've got a pretashop 1.7.7.0 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}"/> <span>{$product.condition.label}</span> </div> {/if}</span> {/block}" , 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 More sharing options...
musicmaster Posted September 7, 2021 Share Posted September 7, 2021 On 9/6/2021 at 4:24 PM, NunoACruz said: {if $product.condition} Try {$product.condition AND ($product.condition != "new")} Link to comment Share on other sites More sharing options...
NunoACruz Posted September 7, 2021 Author Share Posted September 7, 2021 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 More sharing options...
musicmaster Posted September 7, 2021 Share Posted September 7, 2021 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". Link to comment Share on other sites More sharing options...
NunoACruz Posted September 8, 2021 Author Share Posted September 8, 2021 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 More sharing options...
musicmaster Posted September 8, 2021 Share Posted September 8, 2021 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. Link to comment Share on other sites More sharing options...
NunoACruz Posted September 8, 2021 Author Share Posted September 8, 2021 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now