Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to acheive a blank price on product page


starfox221

Recommended Posts

Posted

Basically, the situation that I have is that I have products that have prices (of course), but then my store also offers products that require you to request a quote, so in those situations, I'd rather not display a price. I have tried entering nothing in the price field when adding a product, but I am trying to figure out a solution to circumvent it defaulting to $0.00. Is there a way to do this? Maybe Database side?

 

Also, how to achieve this on shipping, as well?

 

If either is at all possible.

Posted

The quote system is really for custom quotes not really products, the way it works is only the customer and store owner can see the quote so its not really for this.

 

The easy way i would suggest would be to make a slight change to your currency class.

 

From catalog / includes / classes / currencies.php

Line 72 & 73 find

 

 


     function display_price($products_price, $products_tax, $quantity = 1) {
      return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
    }


 

and change it to

 


    function display_price($products_price, $products_tax, $quantity = 1) {
      if ($products_price > 0.01) {
   return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
   }else{
   return 'Contact us for a quote';
   }
    }

 

Set your prices for the quote to 0.00 as you were doing, then instead of a price it will display the message, this will effect every price call on the store side.

 

You could then go one step further and replace the buy now buttons with a contact us one.

 

 

 

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Posted

The quote system is really for custom quotes not really products, the way it works is only the customer and store owner can see the quote so its not really for this.

 

The easy way i would suggest would be to make a slight change to your currency class.

 

From catalog / includes / classes / currencies.php

Line 72 & 73 find

 

 


     function display_price($products_price, $products_tax, $quantity = 1) {
      return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
    }


 

and change it to

 


    function display_price($products_price, $products_tax, $quantity = 1) {
      if ($products_price > 0.01) {
   return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
   }else{
   return 'Contact us for a quote';
   }
    }

 

Set your prices for the quote to 0.00 as you were doing, then instead of a price it will display the message, this will effect every price call on the store side.

 

You could then go one step further and replace the buy now buttons with a contact us one.

 

That actually worked perfectly. When you say you could "replace" the buttons, do you mean store wide or just on those particular products? I'd rather have it just on those products, and actually, if it just removed the buy now button, that would work even better. I have built in contact forms of each of the product pages.

 

Thanks so much for your help.

Posted

To do that open product_info.php and find around line 213

 

           	<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

Change it to

 

      		<?php if ($product_info['products_price'] >0){  ?>
           	<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
      		<?php
           	}
      		?>

 

This will only show the add to cart button if the price is higher than 0.00

 

Nic

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...