Jump to content

Product::idIsOnCategoryId problem


SteveP

Recommended Posts

I am trying to upgrade my 1.2.5 install to the 1.4 latest and have a problem with a module I had written. The module needs to find out if the products in the cart are in a certain category, so it uses Product::idIsOnCategoryId().

 

Under 1.2.5 I have no problems, but in 1.4 it always returns false. In debugging that code I see that the actual ExecuteS() call for the SQL returns a row with data, but the call to ->NumRows() is returning 0. I can't imagine how this can be failing for me but not failing for other cases where it is called.

 

Just for the record, I am calling it like so:

 


$retCategory = Category::searchByName(0, Configuration::get('spquantitydiscount_name'), true);
if (Product::idIsOnCategoryId($id_product, array($retCategory))) {
   .....code here.....
}

 

Again, if I put debug statements in the Product::idIsOnCategoryId() method I can see the generated SQL as proper and I can also see the row returned from the ExecuteS() call, but yet the NumRows() call returns 0.

 

Any insight?

Link to comment
Share on other sites

  • 2 weeks later...

Strange, I could never find this problem. So, I unpacked a new copy from the download and moved my modifications into it (just mail, modules, etc) and the problem has not re-appeared. Bizarre. I wish I could figure out what caused it to stop working in the first place. :)

Link to comment
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
×
×
  • Create New...