Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Downside of returning to the product-info-page after login?


AngusD

Recommended Posts

Hi,

 

I've noticed, when you look at a product (and maybe some other pages) and then login into the store, you're being redirected to the store index-page.

 

Wouldn't it be better, if you're being directed back to the page you came from after a login?

 

What could be a downside of doing this?

 

AD

Link to comment
Share on other sites

This -might- work...

 

 

Find this:

 

if (!isset($HTTP_GET_VARS['products_id'])) {
 tep_redirect(tep_href_link(FILENAME_DEFAULT));
}

 

Add this after it:

 


if (!tep_session_is_registered('customer_id')) $navigation->set_snapshot();

Link to comment
Share on other sites

Hi,

 

thank you, I've changed it myself already.

 

I wanted to know if there was a reason not to do this, or has just no one thought of doing it?

 

AD

 

PS: I would add the code directly before the sql-statement. No sense in setting a snapshot when there's no product to display.

Link to comment
Share on other sites

Wouldn't it be better, if you're being directed back to the page you came from after a login?

 

What could be a downside of doing this?

 

In general, on most good websites, if you have to take a side-trip to another page (for a single, well-defined purpose, such as for logging in) you will return to your original page. There might be cases where this would be impractical, or possibly a security exposure, but in general that's the expected behavior these days. To end up at some general "start" page, simply because the programmer hard coded it as the return page, is not acceptable in this day and age.

 

The downside is that you have to track where you "jumped out of the normal flow" so you can remember where to return to. If the state of the session changes quite a bit during the side trip, it might be better to reset by going to a general start page rather than confuse the visitor by having a (possibly subtle) change in the state of things. For a shopping cart, I can't think of anything off the top of my head that would be made worse by returning to a page after logging in, but there might be some special cases, such as logging in restores a saved cart, and you already have some merchandise in your cart as a guest (how are the carts merged?). You need to pay attention to details like that in order to minimize surprises and have a happy customer.

 

If your side-trip is very complicated, there might be confusion over what the expected return page and state should be. For a simple login, that shouldn't be a problem. For action A which leads to action B which leads to action C, where should the user end up?

Link to comment
Share on other sites

@@burt : The overhead shouldn't be a big problem. Though it depends on the store and the server. I thought about the application_top, too, but then you need to define exemptions (no need to set a snapshot in the login ;) ).

 

@@MrPhil : Some good and valid points, but I think you're thinking too complicated. OsC "tracks the flow" by setting a snapshot of the current page, not all, but a few where it is necessary. Merging anonymous-carts with user-carts is something OsC does really well too. Besides, you jump back to the origin after a login after everything is said and done in the login-script. It's more of a surprise when you're looking at a products and then you're being directed to the index-page after a login.

 

Ideally, you let the user after action C decide: Back to the page that led to action A or the index-page or any other page. You shouldn't decide for him in this case. An automatic redirection would cause the user to think something went wrong. He would either quit or repeat the process unnecessarily.

 

AD

 

PS: It is a bit more complicated than adding a simple "set_snapshot()" to the product_info-page...

Link to comment
Share on other sites

@@AngusD, I was speaking more in the sense of generically what a cart ought to do, not specifically what osC does or does not do. I agree that unless there are some sort of complications involved that make it difficult or insecure to return to the original page from your login page, that there's no reason why not to do so. That is what a user would intuitively expect, and what many applications offer. Simply returning to a fixed address (store entry page) is so 1999.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...