Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product_info.php and the if statement


infinedi

Recommended Posts

I have many, but not all, products that the price is determined solely from the attributes. I have entered the price as 0.00 for these. The other products are marked as normal. I wanted to get rid of the $0.00 in the upper right hand corner on product_info.php for the prices that are 0.00 and replace it with the statement "Price determined by options" while leaving the other product's prices alone.

 

I have tried several version of an 'if' statement but am getting no where. Can someone help?

 

Sheri

Link to comment
Share on other sites

:P Yahoo! I figured out how to do this ...

 

First, I added a line at the beginning

 

$null_pric = '0.0000';

 

then

 

in product_info.php around line 115 or so you will see

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

 

I replaced this with:

 

// HACK

if ($product_info['products_price'] == $null_pric) {

$products_price = "Price Determined by Selection"; }

elseif ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

 

Thank you so much for this forum :-)

 

Sheri

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...