Community Add-Ons
Hide Price if $0
for osCommerce Online Merchant v2.2
This contribution is intended to hide the price and purchase button from the catalog if no price has been entered, instead of showing a price of $0.00.
This may be of use if you want some items to be informational items only, such as services or to use your shop as a catalog only.
This contribution contains both the files that can be dropped in on a clean copy of OSC2.2M2 as well as instructions for manually applying this contribution for those who have already tinkered with the original files.
Legend:
Download
Report
I found it needed to include this instruction also for this contribution, in product_listing.php find this
section of code:
----------------------------------------
if (PRODUCT_LIST_PRICE > 0) {
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text .= '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
} else {
$lc_text .= ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';
}
}
----------------------------------------
and change it to this:
----------------------------------------
if (PRODUCT_LIST_PRICE > 0) {
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text .= '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
} else {
}
}
----------------------------------------
This will prevent the price from showing as $0.00 when you click on a main categorie or similar, this removes
the price from showing at all for any product until you go to the products page. I hope this is helpful!
The attatched download is just exactly these instructions so no need to open it really.
