Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Join Date
    Jul 2007
    Posts
    30
    Plugin Contributions
    0

    Default How to return to product page after login?

    I found it hard to believe this wasn't a default setting in ZenCart. It doesn't even seem to be an option in ZenCart. When a customer is viewing a product, and they click login so they can buy the product, I want them to be redirected back to the product page.

    I have set up the site for my client to only show prices to logged-in, authorised, customers. This is because it is being used as a secure online ordering system for approved account customers only. Just giving his detail in case it affects the behaviour seen.

    This is driving me crazy. I have done lots of searching, and found a handful of other people asking the same question, and found one or two posts saying, "You can do it, but it'll be hard..." but nothing that tells me HOW! Someone, please help me... this is getting urgent.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,692
    Plugin Contributions
    11

    Default Re: How to return to product page after login?

    In the admin, what do you have under customer details in the configuration menu for customer shop status and customer approval status.

    If you are not letting just anyone who has logged in shop, the system is not set to return them as they are not authorized.

    If the settigs are, for example, 2 and 0 respecitively, the system should return them to the item. If they are waiting for authorization ( settings 2, 2), the system will not return them as they are not authorized to buy until someone authorizes them.

    Not sure you'll be able to automate the process to the point of allowing the CORRECT customer to get to the prices without allowing just anyone who logs in to also get to pricing and shop.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: How to return to product page after login?

    If a customer is in checkout flow and needs to login, it does redirect them back to where they came from.
    For non-checkout pages, it does not.

    Are you concerned *only* about product pages at this point?
    Which product-types are you using in your store?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,692
    Plugin Contributions
    11

    Default Re: How to return to product page after login?

    Quote Originally Posted by dbabbage View Post
    I have set up the site for my client to only show prices to logged-in, authorised, customers. This is because it is being used as a secure online ordering system for approved account customers only. Just giving his detail in case it affects the behaviour seen.
    Is the customer sent to the site to be authorized or discovers the site and wants to be authorized? Not having prices shown would not generally be conducive to getting me in a buying mode.

    If you create an account in advance for the customer, they will, as Dr Byte says, be able to do what you wish BUT (in my experience) they will still need to login before it happens due to the setup you've chosen.
    Last edited by dbltoe; 7 Sep 2007 at 07:03 PM.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  5. #5
    Join Date
    Jul 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to return to product page after login?

    The site is live. Feel free to visit at http://www.blick.co.nz

    Quote Originally Posted by DrByte View Post
    If a customer is in checkout flow and needs to login, it does redirect them back to where they came from.
    For non-checkout pages, it does not.

    Are you concerned *only* about product pages at this point?
    Which product-types are you using in your store?
    OK, this has clarified what is going on. On a development install I tried changing the store to displaying prices all the time so I could see how it would work in that scenario. Having done some testing, I now understand why there isn't the public outcry that I'd have expected there to be. If your store displays prices even when someone isn't logged in, and you can "Add to Cart", then people usually will do that. When they go into the checkout process, they are then seamlessly returned to where they'd expect to be.

    My client's store is not an usual e-commerce site. Rather, it is an online ordering system for their approved account customers. For reasons based on a clear business rationale, they do not want to display prices on the site to non-approved customers. Currently, I have the site set up to just say "Login for price" next to the products themselves. The customer uses the "Log In" link on the navigation bar, as I've removed other Log In links from the page... there were just too many. (Perhaps this is where I went wrong.)

    This might indicate a solution. If there was a "Buy Now" button next to a product, even without it displaying prices, could this somehow put them into the checkout flow and thus at least return them to a vaguely sensible location?

    But what I really want, is that when someone clicks that "Log In" link on the navigation bar they are returned after log in to whatever page they clicked it from... whether it be a category listing, or an individual product page, or a EZ Page, or whatever. To me, this is the obvious and expected behaviour that a site user would expect... Can it be done?

    Quote Originally Posted by dbltoe View Post
    Is the customer sent to the site to be authorized or discovers the site and wants to be authorized? Not having prices shown would not generally be conducive to getting me in a buying mode.

    If you create an account in advance for the customer, they will, as Dr Byte says, be able to do what you wish BUT (in my experience) they will still need to login before it happens due to the setup you've chosen.
    As above, the client has a clear rationale and business plan about how they want to use the site. It is not intended to drive casual sales, but rather to support orders from account customers and to encourage new account customers. And I am talking about people who are already authorised customers who are returning to the store but who start browsing before they think to log in. We just don't want to annoy them every time they use the site. (It annoys us, so it will definitely annoy the customers.

  6. #6
    Join Date
    Jul 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to return to product page after login?

    Quote Originally Posted by DrByte View Post
    Which product-types are you using in your store?
    Sorry, forgot to answer this. The only product type is Product - General.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,445
    Plugin Contributions
    81

    Default Re: How to return to product page after login?

    Quote Originally Posted by dbabbage View Post
    But what I really want, is that when someone clicks that "Log In" link on the navigation bar they are returned after log in to whatever page they clicked it from... whether it be a category listing, or an individual product page, or a EZ Page, or whatever. To me, this is the obvious and expected behaviour that a site user would expect... Can it be done?
    There are a number of places to make changes if you want it to happen "everywhere". I'm not so sure it's necessary to do it "everywhere", but the following will do it for your Product-General products. If you want to experiment with adding it elsewhere too, that's fine. However, the only place requiring login would be the product/category pages, the My Account areas, and the normal checkout flow. The My Account and Checkout and tell-a-friend and write-a-review already take care of it. A variation of this will be implemented in a future release. A number of authentication issues come to play in this with the many possible configurable modes in which Zen Cart can run. Consider this a fairly solid bandage:

    /includes/modules/pages/product_info/header_php.php
    Below this line:
    Code:
      require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    ... add the following lines:
    Code:
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
    }
    If you really feel that ezpages also needs it, do the same in the includes/modules/pages/page/header_php.php file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jul 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to return to product page after login?

    The passion with which I now hold you in high regard is such that, on first reading this post, my mind briefly wandered to the possibility of bearing your children. Admittedly, I am male, and it is possible you are too, so this may not be physiologically possible. Perhaps we can settle for me saying THANK YOU THANK YOU THANK YOU. How could it be so simple and so fast? Works flawlessly... you've eliminated a huge headache for me. Excellent.

  9. #9
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,692
    Plugin Contributions
    11

    Default Re: How to return to product page after login?

    Time to buy the Dr a cup of coffee. That's the best way to keep things going'.

    http://www.zen-cart.com/index.php?ma...es&pages_id=14
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  10. #10
    Join Date
    Jul 2007
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to return to product page after login?

    Hmm, something odd going on here. This works flawlessly on my offline install of Zen Cart, accessed with both Firefox and Safari. In the actual online store, now I've installed the files, it seems to work just fine in Firefox, but only works intermittently in Safari. I thought it worked once in Safari, but if you logged out and in again it then stopped working. However, quitting and restarting Safari doesn't always get it working again.

    It seems like the code is searching for info attached to the Session ID. Presumably this problem might be about session IDs persisting after log out? Not sure why this would be different in my local and web installs—the Session ID settings in Admin are the same. Any clues, anyone?

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 24 Jul 2013, 03:56 PM
  2. Return to Same Page after Log In
    By arpeggio in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 22 May 2010, 09:52 AM
  3. How to return to product page?
    By Sjolie in forum General Questions
    Replies: 1
    Last Post: 5 Jan 2010, 10:10 PM
  4. Login > Return to previous page
    By beyre in forum General Questions
    Replies: 2
    Last Post: 15 Oct 2009, 08:19 PM
  5. How to Return to Multiple Product List After Adding to Shopping Cart
    By maineiac13 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Sep 2008, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg