arc Posted July 18, 2003 Posted July 18, 2003 hi, in a nutshell, i wouldl like to leave sold products still on the site. only problem i am encountering is that instead of displaying the price below my image, i want it to say sold out. i located the block of code in product_listings.php here is the original block of code: else { $lc_text = ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' '; } i tried to insert an "if" statement like this: else { if ($listing_values['products_quantity'] == '0') { $lc_text = 'SOLD'; } else { $lc_text = ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' '; } } Thanks! Johnny
lysander Posted July 21, 2003 Posted July 21, 2003 Remove your code - it's not necessary!!! Just go to the admin panel - click configuration -> Stock- and where it says Mark Products out of stock - click this line and just edit the stars (***) to say SOLD. One little tip is to put a space before SOLD otherwise it ends up too close.
arc Posted July 22, 2003 Author Posted July 22, 2003 lysander, thanks but that only shows up when they add it to their basket right? i have that setup and it doesn't do what i need it to do. i need it to say SOLD on the category page. thanks! =)
lysander Posted July 22, 2003 Posted July 22, 2003 OOOppss - Sorry I didn't quite read your post properly. I'm not able to test your code - but it looks like there may be a small syntax error - I think that if you are on an 'else...if' statement the if has to be with it not the other side or the curly braces. (http://uk2.php.net/manual/en/control-structures.elseif.php) if ($a > $B) { print "a is bigger than b"; } elseif ($a == $B) { print "a is equal to b"; } else { print "a is smaller than b"; } So yours should look like elseif ($listing_values['products_quantity'] == '0') { $lc_text = 'SOLD'; } else { $lc_text = ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' '; } } But I'm no programmer!!! So I hope this helps.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.