Community Add-Ons

Add file to this package
Top » Features

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
Expand All / Collapse All
Just an added Instruction rabbitseffort 2 May 2006  

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>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
} else {
$lc_text .= '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
}
}
----------------------------------------

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>&nbsp;&nbsp;<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.

Category use shopping cart (corrected) claudioimai 23 Aug 2005  
Category use shopping cart claudioimai 23 Aug 2005  
2b step 4 fix Scott 1 Jan 2005  
Hide Price if $0 v.2b Steel Shadow 19 Jun 2004  
Hide Price if $0 v.2 (Islander2u) Eric Montgomey 16 Jun 2004  
Hide Price if $0 (Islander2u) Eric Montgomey 28 Jan 2004