Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Out Of Stock Buttons


aslanstudios

Recommended Posts

Posted

I installed the Display Out Of Stock Buttons contribution and now all of my products diplay the out of stock buttons. Any ideas?

Posted

OK, I deleted all the files that where changed and started from scratch.

 

Unfortunately, It's still not working.

 

The only thing I can see that might be different is the fact that I am not using a template.

Posted

I am sorry to say, but I am glad that somone else is having the same problem. I thought it was just me. Ive been fighting this for about two weeks now, and cant figure out why it is causing this.

 

In catalog/includes/modules/product_listing.php, I have tried two methods, (Display out of stock buttons, contribution 1882) and a slight change to a contribution of my own, (Hide Price of $0, contribution 1826) changing the line that reads:

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

to either

$lc_text = ' ' . (($listing['products_quantity'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : '') . 'out of stock';

or to

If ($listing['products_quantity']<>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> ';
}else{    
$lc_text =  'out of stock';
}

 

The odd thing is that if I change 'product_quantity' to 'product_price' it works (provided that i have a product at $0), its just the 'product_quantity' that doesnt seem to want to play nice with others.

 

Anyone have any ideas why this would be?

Archived

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

×
×
  • Create New...