Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Sign in to follow this  

Product_status help please

Recommended Posts

I am trying to call a product's status in products_info.php, based on the contribution Product Listing Stock Status 1.0.0

by Ross Lapkoff.


Credit where credit is due!


I have 3 states based on

0 out of stock

1 in stock

2 Pre-order


I have integrated the status in product_listing, new products and am now attempting to do the same for products_info.


My problem is that when I call the function the query is empty.


I have tried a number of variations but to no avail.


It seems that no matter how I do this I can't pass the product_id to the function to return the status name. I even wrote my own function based similar to manufactures name query but still no joy.


Some background.


There is an addition field in products (products_status) which is filled from a new table (products_status_id, products_status_name)

products_status holds the value from products status_ id (0, 1, 2) products_status_name is the text value.


here is a copy of the original function, (which works in products_listing etc)


function tep_get_products_status_name($products_status, $language_id = '') {

global $languages_id;


if (!$language_id) $language_id = $languages_id;

$product_status_query = tep_db_query("select products_status_name from " . TABLE_PRODUCTS_STATUS . " where products_status_id = '" . $products_status . "' and language_id = '" . $language_id . "'");

$product_status = tep_db_fetch_array($product_status_query);


return $product_status['products_status_name'];




I most likely can't see the trees for the forest but if anyone has a suggestion - any and or help would be appreciated. If I can get it to work it will end up as a contribution.


Much thanks -


Regards Seb

Share this post

Link to post
Share on other sites

I can't see anything unusual inthere but that does not guarantee there isn't :)

What I always do is check if


a) the $variables I use exist (simply 'echo' them)

B) the query does work if I substitute $vars with normal text

(ie where $id=1 instead of where $id=$nr)




"Politics is the art of preventing people from taking part in affairs which properly concern them"

Share this post

Link to post
Share on other sites

fixed, I realy could'nt see the trees for the forest, I was'nt calling it right


should have been

<?php echo 'Status: ' . tep_get_products_status_name($product_info_values['products_status']); ?>



Share this post

Link to post
Share on other sites



I hope this didn't need to be a new thread, but I can't seem to find the contribution you have mentioned, Product Listing Stock Status 1.0.0.


Can you post the link to it?




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this