Error in logic of ZMShoppingCart's getQty-method?

Problems that you cannot find a category for.

Moderators: ckosloff, DerManoMann

Error in logic of ZMShoppingCart's getQty-method?

Postby Mindbox » Wed Feb 10, 2010 12:08 pm

I've implemented the getQty-method and I'm wondering about the result of my requests. I have acutally just one article in my cart. When I set the isQtyMixed-parameter to false, I get the right amount of my requested item. But when I use true as parameter-value the response is 0. I've understood the parameter so that it just returns the requested amount of the ItemId or all variations in the basket? So should it not be right that I get in both cases 1 as result or did I misunderstood the logic of the parameter?
Mindbox
Beginner
 
Posts: 28
Joined: Wed Feb 03, 2010 6:13 pm

Re: Error in logic of ZMShoppingCart's getQty-method?

Postby DerManoMann » Wed Feb 10, 2010 12:37 pm

Gosh - I don't know. I'll have to look at the code. My first guess would be that in this case it should be 1 for both. GIve me some more time on this one - its past midnight and I got to go......
DerManoMann
Founder
 
Posts: 305
Joined: Wed Oct 21, 2009 8:52 pm
Location: New Zealand

Re: Error in logic of ZMShoppingCart's getQty-method?

Postby Mindbox » Wed Feb 10, 2010 1:33 pm

Yes no problem - thats nothing which would stop my work atm ;-) And indeed - it must be late at your location (GMT +12) ??
Mindbox
Beginner
 
Posts: 28
Joined: Wed Feb 03, 2010 6:13 pm

Re: Error in logic of ZMShoppingCart's getQty-method?

Postby DerManoMann » Wed Feb 10, 2010 10:27 pm

Mindbox wrote:Yes no problem - thats nothing which would stop my work atm ;-) And indeed - it must be late at your location (GMT +12) ??

I think that's another bug. In ZMShoppingCart in the method getQty there is a line:
Code: Select all
        foreach ($contents as $pid) {

that should read:
Code: Select all
        foreach (array_keys($contents) as $pid) {

deng!
DerManoMann
Founder
 
Posts: 305
Joined: Wed Oct 21, 2009 8:52 pm
Location: New Zealand

Re: Error in logic of ZMShoppingCart's getQty-method?

Postby Mindbox » Thu Feb 11, 2010 9:55 am

Great - looks much better. Now I get in both cases the right amount. (Btw: I have to say your fast in bugfixing ;-) )
Mindbox
Beginner
 
Posts: 28
Joined: Wed Feb 03, 2010 6:13 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron