Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quantity in Product Listing


Orbixx

Recommended Posts

Hi,

 

I've been diving through code to find where exactly OSC outputs the product quantity to the product listing screen in hope of changing what it outputs.

 

My aim is somewhat like...

 

if (stock >= 1) {

echo 'In Stock';

}

else {

echo 'Out of Stock';

}

 

I have a similar thing in the product viewer page, but I'd like to do this in the product listing page and cannot seem to find where I can do this.

Link to comment
Share on other sites

Never mind, found it.

 

For those who want to know...

 

/httpdocs/includes/modules/product_listing.php

 

Around line 105ish.

 

Find:

 

$lc_text = ' ' . $listing['products_quantity'] . ' ';

 

Replace with:

 

			if ($listing['products_quantity'] >= 1) {
		$lc_text = ' <font color=green>In Stock</font> ';
		}
		else {
		$lc_text = ' <font color=red>Out of Stock</font> ';
		}

 

Hope this helps someone.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...