Micke Posted July 1, 2006 Share Posted July 1, 2006 Even though I have very poor knowledge in PHP I have succeded in installing many contributions. There is however one thing that I have never gotten quite right. It's the part in product_listing.php in the "Hide price if $0"contribution. I want to show all prices in the product listing exept from those at $0. (Installing the contribution right "out of the box" hides all prices in the product listing. Removing it shows all prices with $0 too...) Now I'm trying a different approach, maybe the if-else (for specials) in product listing could be used to select the $0's and show the TEXT_CALL_FOR_PRICE instead... Since I'm a cut-and paste kind of guy I can't make it work. I still hides all prices... Anybody knows what to do? In catalog/includes/modules/product_listing.php case 'PRODUCT_LIST_PRICE': $lc_align = 'right'; if (tep_not_null($listing[$x]['specials_new_products_price'])) { $lc_text = '?<s>' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</s>??<span class="productSpecialPrice">' . $currencies->display_price($listing[$x]['specials_new_products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '</span>?'; //BOF Here's what I'm trying to do } elseif ($listing['products_price'] == 0) { $lc_text = '?' . ( TEXT_CALL_FOR_PRICE ) . '?'; //EOF Here's what I'm trying to do } else { $lc_text = '?' . $currencies->display_price($listing[$x]['products_price'], tep_get_tax_rate($listing[$x]['products_tax_class_id'])) . '?'; } break; Quote Link to comment Share on other sites More sharing options...
Jan Zonjee Posted July 1, 2006 Share Posted July 1, 2006 It should at least be (note the [$x]): //BOF Here's what I'm trying to do } elseif ($listing[$x]['products_price'] == 0) { Quote Link to comment Share on other sites More sharing options...
Micke Posted July 2, 2006 Author Share Posted July 2, 2006 Thank you JanZ! I don' know this little the [$x] fellow but that did it for me! //Micke Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.