lat9 / one_page_checkout

One-Page Checkout for Zen Carts v1.5.7a and later.
GNU General Public License v2.0
15 stars 11 forks source link

unknown address book ID error... #378

Closed proseLA closed 1 year ago

proseLA commented 1 year ago

i really do not understand this class OnePageCheckout. or perhaps i just do not understand ZC.

this class gets instantiated here:

https://github.com/zencart/zencart/blob/078b509bb514ab344a034e89508eb02f1e63854c/includes/autoload_func.php#L54

but as far as i can tell that happens at logoff, not at login. which seems weird to me.

now, i'm not really sure why in the __construct method, we are not doing a $this->reset();.

and i do not understand the $_SESSION["opc"] and when that is getting set or unset.

i have been able to get into the checkout with values for $_SESSION["opc"]->tempAddressValues["ship"]["address_book_id"] which are not related to the current customer logged in via the admin.

i think this is where that problem lies.

lat9 commented 1 year ago

opc, like the session's cart gets instantiated once each session. I agree that the admin-based customer login (where the admin's browser session is used for multiple customers) is most like the culprit.

lat9 commented 1 year ago

@proseLA, I (as you, I think) believe that this issue was resolved in the base Zen Cart change (https://github.com/zencart/zencart/pull/5854) that's currently been merged for the next release.

Can this OPC issue be closed?

proseLA commented 1 year ago

no. i just saw a new one today. but i have not had enough time to investigate. hopefully soon.

lat9 commented 1 year ago

Dang it; I was very hopeful.

proseLA commented 1 year ago

now you can close it.

i hate var naming.

to replicate error, have 2 customers who BOTH have multiple address book entries, and whose default is set. use the HMAC to place an order for one. then without logging out, place the order for the second one. i have been able to replicate the error like that without fail. and will PR over at the base.

95% sure this one is it,. but feel to see if you can replicate it yourself.

lat9 commented 1 year ago

How the heck did you figure that out? Thank you!

proseLA commented 1 year ago

How the heck did you figure that out? Thank you!

tenacious like a pitbull...