In the primary way of logging out, the user is not logged in. Like many sites, we don't really utilize the login feature (in the process of adding it in, though!). When the user enters the address and optional shipping address, all works well. If I enter garbage or fill out the shipping address halfway, it doesn't matter if I uncheck the "shipdiff" checkbox. The cart ignores whatever was entered in the shipping area (if anything) if that box is not checked.
When I am logged in and have a number of addresses associated with my user account, the system and display of addresses in the cart uses a different system. It works, and saves the user from having to type in his address(es) every time he orders.
Here's a small problem I found while setting up a new user. I can reproduce it on the ECT demo store, so it's likely not my own personal goof-up! Here's how to re-create it:
- Create a new account.
- Put something in the cart, and to go checkout.
- Since there are no saved addresses associated with the new account, the address entry screen looks the same as normal (not logged in). Enter a billing address.
- Check the shipdiff box and enter a shipping address, but do not enter a state.
- Uncheck the shipdiff box. Click to proceed to the next screen.
At this point, the user gets an error message:
quote:
If you enter a separate ship address you must enter all address details.
You must select a state before proceeding.
It doesn't crash or destroy anything in a horrible way. It just seems like a loose end that could use tidying up.
The user gets the error message (which might seem weird since they unchecked the different shipping address). The cart then shows the now saved Billing Address, and sets the ship to as the same as the billing. Anything that was entered in the shipping address fields, causing the error, is now lost to the user. They're in the database, visible in Admin, at least until the user hits submit again.
It seems as if this "edge" case somehow got missed. It's an easy thing to miss in testing, since it only comes up when creating a new account. We only caught it because we're planning on starting to use the login feature, and expect to have a lot of existing users start using it.
Technical:
The problem is that the cart doesn't check the status of the shipdiff checkbox if the user is logged in. There's a line in /vsadmin/inccart.asp that's something like:
if (SESSION("clientID")="" AND getpost("shipdiff")="1") OR (SESSION("clientID")<>"" AND (getpost("saddaddress")="add" OR getpost("saddaddress")="edit")) then
I wonder if this is a minor-bug-fix you might include in some future update. In the more immediate future, do you have any thoughts about what logic to add there to make the cart ignore entered ship fields if that box isn't checked, but it's not using some saved address?
Thanks!