Contributions
If price = 0.00 dont display price
This is basicly if you have products that you want customers to contact you for the price.
if you enter a products cost in as 0.00 then it will not display it.
It works normally if its 0.01 or over.
Expand All / Collapse All
Hi, i think this code make the same result:
open: includes/classes/currencies.php
find :
function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
Replace:
function display_price($products_price, $products_tax, $quantity = 1) {
if ($products_price > 0.01){ //for change price by 'contact'
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}else{
return 'Contact us';
}
}
note: only one text file include
Updated for 2.2RC2a. I took the text file and applied changes to the actual files. Now you can use a diff program to include the changes into your files.
I also modified the code a bit so that instead of "----->" and "Phone for Price" it creates links to the product page that say "Check Price" and "More Details".
I am using this in conjuction with links in my product description to link to an affiliate page. See the discussion here:
http://forums.oscommerce.com/index.php?showtopic=295502&hl=affiliate
in relation to previous post this will remove product info link associated with image if price is 0.00
In response to a request to have product name not linking to product info page ONLY if price is 0.00
changed product info around line 326 so that instead of "phone for quote "it displays a mailto link which when clicked sends an email to the shop owner asking for more info
<td class="main" align="right"><?php
if ($product_info['products_price'] < 0.01){
echo "<a href='mailto:shopowner@shop.com?subject=Please send more info about $products_name'>Email for a quote!</a>";
} else {
change shopowner@shop.com to your email address.
the zip file is blank
This is a complete guide from start to finish.
This will remove the prices and add to cart button for items the cost 0.00
This is the update for users which have already installed the previous mod.
this update will remove the add to cart button and the price from the specials page, new items page and the review page.
I have made the text file clearer aswell as removed to add to cart button on the products description if price = 0.00
Also corrected a badly worded line which could make the prices not disapear in the categories.
This is basicly if you have products that you want customers to contact you for the price.
if you enter a products cost in as 0.00 then it will not display it.
It works normally if its 0.01 or over.
Note: Contributions are used at own risk.