Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Very basic question re: product field test


Hbelkin

Recommended Posts

I last programmed years ago, and never in php, but seems fairly simple... however I have a (probably silly) question:

 

In product_listing.php code, I'd like to test for products_status being = 0 and do an action if this is so. I have no problem with the code structure or the action, but I'm not certain how to test for the actual value...

 

I tried: if ( $listing['products_status'] == 0 ) but this doesn't return the correct value. My assumption was the the $listing array somehow already held the retrieved database entries... but it seems as if this is not correct.

 

The area in product_listing.php that I'd like to add this to is around the case 'PRODUCT_LIST_BUY_NOW': section (I have made other mods, so the line numbers are not useful)

 

Someone care to enlighten me on what is probably an obvious answer here? Thanks!

Link to comment
Share on other sites

products_status is not passed in the array from index.php to product_listing.php.

 

Either you can add it to the array or have a separate query on the product_listing page which grabs the status based on $listing['products_id'].

Your online success is Paramount.

Link to comment
Share on other sites

products_status is not passed in the array from index.php to product_listing.php.

 

Either you can add it to the array or have a separate query on the product_listing page which grabs the status based on $listing['products_id'].

 

Thanks for the reply. This of course makes sense. As a newcomer to OScommerce and to psp to some extent, could you please elaborate (or show example) on where/hom to add it to the initial array? I'd hate to create another query for this (as I'll later need it in several other places as well). Also: in your opinion, would adding it to the array break anything else? (I'd assume not...)

 

Thank you again!

Link to comment
Share on other sites

Thanks for the reply. This of course makes sense. As a newcomer to OScommerce and to psp to some extent, could you please elaborate (or show example) on where/hom to add it to the initial array? I'd hate to create another query for this (as I'll later need it in several other places as well). Also: in your opinion, would adding it to the array break anything else? (I'd assume not...)

 

Thank you again!

 

Anyone out there able to help? Thanks!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...