yasic Posted October 1, 2012 Share Posted October 1, 2012 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 More sharing options...
CartExpert.net Posted October 1, 2012 Share Posted October 1, 2012 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 1 Link to comment Share on other sites More sharing options...
yasic Posted October 2, 2012 Author Share Posted October 2, 2012 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 More sharing options...
CartExpert.net Posted October 2, 2012 Share Posted October 2, 2012 Hi. In the product.tpl you need the code: $product->condition Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
yasic Posted October 2, 2012 Author Share Posted October 2, 2012 thanks again but i don't know how i would write the code for product.tpl to display the condition as well. could you give me an example please? Link to comment Share on other sites More sharing options...
CartExpert.net Posted October 2, 2012 Share Posted October 2, 2012 Hi. Just put the code: {$product->condition} to the spot where you want the condition to be displayed. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
yasic Posted October 2, 2012 Author Share Posted October 2, 2012 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 More sharing options...
CartExpert.net Posted October 2, 2012 Share Posted October 2, 2012 Hi. You have to add if statements to the TPL file and then you can use different styles and texts for it. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
yasic Posted October 2, 2012 Author Share Posted October 2, 2012 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 More sharing options...
CartExpert.net Posted October 2, 2012 Share Posted October 2, 2012 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 2 Link to comment Share on other sites More sharing options...
faDdy Posted March 9, 2013 Share Posted March 9, 2013 {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 More sharing options...
[email protected] Posted May 11, 2013 Share Posted May 11, 2013 Please help me ant tell me where exactly i enter this code thank you very much in advance 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