Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Disabling Buy now for 0.00 price items


Steel

Recommended Posts

Posted

I have tried alot of the contribs for Disabling Buy now for 0.00 price items this and am not having much luck they all seem to be out dated I have tried coding it myself and keep getting parse errors. Anyone got any ideas?

 

Here is the orig code:

 

$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

 

Here is the code I put in trying to get it to work that Im getting parse errors on:

 

if ($listing['products_price'] > 0) { $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
if ($product_info['products_price'] == 0) {  ';

 

Here is another code from a contrib that WILL disable the buy now button BUT it disables ALL the buy now buttons not just the specific ones controled by price:

 

if ($listing['products_quantity']<=0) {
   $lc_text = tep_image_button('button_buy_now_na.gif', IMAGE_BUTTON_BUY_NOW_NA) . ' ';
 } else {
   $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
           }

 

ANY HELP would be appreciated VERY MUCH!!!!!!! NO ONE seems to know anything about this.

 

THANK YOU,

Steel

Posted

dont know if you fixed this yet but this is what i did for another client awhile ago and all seems well...

 

in catalog/includes/modules/product_listing.php to stop price from showing change to:

 

case 'PRODUCT_LIST_PRICE':

$lc_align = 'right';

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 = ' ' . (($listing['products_price'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : '') . ' ';

}

 

 

to remove buy now button change to:

 

case 'PRODUCT_LIST_BUY_NOW':

$lc_align = 'center';

$lc_text = (($listing['products_price'] > 0) ? '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ' : ' ');

break;

}

 

 

then in catalog/product_info.php

 

change to:

 

<TR>

<TD class="pageHeading" valign="top"><?php echo $products_name; ?></TD>

<!--<td class="pageHeading" align="right" valign="top"><?php //echo $products_price; ?></td>-->

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>

</TR>

 

 

 

also change:

 

 

<TD class="main"><?//php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></TD>

<!--<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 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); ?><?php echo (($product_info['products_price'] > 0) ? tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : ''); ?>

 

 

 

think that about does it...

 

 

take care!

Archived

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

×
×
  • Create New...