Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default bypassing create account success with empty cart

    I was wondering if this is possible and if it isn't a time consuming pain, can someone please guide me...

    I changed my filenames.php file to bypass the create account success page and go directly to checkout_shipping. But if the person has an empty cart and is just signing up for an account, they get a "Login Time Out ---
    Whoops! Sorry, but you are not allowed to perform the action requested. "

    Is there some kind of "if" statement I can add to the create account.php that directs the customer to checkout_shipping if there are items in the cart and to maybe the home page or something if their cart is empty? (I could easily put a little note near the submit button on the create account page that lets them know which places they will be directed to depending on their circumstances)

    Any help would be greatly appreciated

    (or even better... could we change back the filename.php file back to normal and have the new "if" statement I mentioned above have the create account success page appear only if there are no items in the cart, and then have it not appear and just go to checkout_shipping if there are items in the cart?)

    P.S. I hope I'm not confusing you!!
    Last edited by craftzombie; 14 Dec 2006 at 11:45 AM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: bypassing create account success with empty cart

    /includes/modules/pages/create_account_success/header_php.php
    lines 19-24 say this:
    Code:
    if (sizeof($_SESSION['navigation']->snapshot) > 0) {
      $origin_href = zen_href_link($_SESSION['navigation']->snapshot['page'], zen_array_to_string($_SESSION['navigation']->snapshot['get'], array(zen_session_name())), $_SESSION['navigation']->snapshot['mode']);
      $_SESSION['navigation']->clear_snapshot();
    } else {
      $origin_href = zen_href_link(FILENAME_DEFAULT);
    }
    Try adding the following AFTER those lines:
    Code:
    // redirect customer to where they came from if their cart is not empty and they didn't click on create-account specifically
    if ($_SESSION['cart']->count_contents() > 0) {
      if ($origin_href != zen_href_link(FILENAME_DEFAULT)) {
        zen_redirect($origin_href);
      }
    }
    I apologize - I haven't tested this. This strategy should work without having to make any changes to other files, including filenames.php. The line-numbers above are based on v1.3.6
    Last edited by DrByte; 14 Dec 2006 at 06:04 PM. Reason: oops ... had missing brackets on count_contents()
    .

    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.

  3. #3
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    Quote Originally Posted by DrByte View Post
    I apologize - I haven't tested this.
    Don't you dare apologize! I am so grateful for your help!

  4. #4
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    I was wondering...

    Is it possible to allow Zen to accept duplicate email addresses (i.e. duplicate accounts)? I would like to make it so that if I made the password optional, they could place future orders using the same email address and not receive the "your email is already in our system" error when entering their billing info. Someone in an old thread mentioned that they did this to their cart. I'm not sure exactly how the db keeps track of info. Are customers kept track of based solely on their email or is there a customer # sort of thing going on?

  5. #5
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    Quote Originally Posted by craftzombie View Post
    I was wondering...

    Is it possible to allow Zen to accept duplicate email addresses (i.e. duplicate accounts)? I would like to make it so that if I made the password optional, they could place future orders using the same email address and not receive the "your email is already in our system" error when entering their billing info. Someone in an old thread mentioned that they did this to their cart. I'm not sure exactly how the db keeps track of info. Are customers kept track of based solely on their email or is there a customer # sort of thing going on?
    Okay, I was able to allow it to accept a duplicate email address by changing a few things to "false" in create_account.php. Is this a bad thing? This is a test site, but I'd like to make this a permanent feature. Am I going to cause problems in Zen by doing this?

  6. #6
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: bypassing create account success with empty cart

    The only issue that I can think of is that customers may create multiple accounts by accident and won't be able to login into their "original" account then.

    The actual orders administration uses the customers_id, not the e-mail address (I did not check this though, it's an assumption)).

    A solution could be to let the customers choose if they want to create an account, and add a field to the customers table which stores this preference ("account_created"). And then check for this "account_created" field when a customers uses the same e-mail address a second time.
    Last edited by paulm; 15 Dec 2006 at 08:39 AM.

  7. #7
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    Quote Originally Posted by paulm View Post
    The only issue that I can think of is that customers may create multiple accounts by accident and won't be able to login into their "original" account then.

    The actual orders administration uses the customers_id, not the e-mail address (I did not check this though, it's an assumption)).

    A solution could be to let the customers choose if they want to create an account, and add a field to the customers table which stores this preference ("account_created"). And then check for this "account_created" field when a customers uses the same e-mail address a second time.
    I was just about to email you. I've been working on this for several hours. I am using your code for the optional password. I edited other code to allow duplicate emails. I changed the "create account success" page to have a checkout button and a continue shopping button in case they were not checking out and were just creating an account. I am currently testing to see what happens with checkout/no password, checkout/password, logging in with email address that was used several times, etc..... check it out. You still have the link?

  8. #8
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    Quote Originally Posted by paulm View Post
    The actual orders administration uses the customers_id, not the e-mail address (I did not check this though, it's an assumption).
    I assume you are correct because when I created new accounts with the same email address, they had different customer id's.

  9. #9
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: bypassing create account success with empty cart

    Sounds interesting :-)

    I just did a quick test. I entered the billing info, but no password and placed an order (the time_out page and error message is a bit confusing when clicking checkout after account creation while the cart is empty, I know that is not what the customer is supposed to do but.....).

    Then I logged out, created a new account using the same e-mail address and entered a password. Then logged out again and logged into the account. Then I checked my account and I saw the order I placed the first time, when I had not entered a password! Obviously (?) this is not what we want.

    I was a bit distracted while testing, so I might have mixed up things. But it looks like the data is mixed or merged. I hope to have time to run some more tests later on.

  10. #10
    Join Date
    Jul 2006
    Posts
    496
    Plugin Contributions
    0

    Default Re: bypassing create account success with empty cart

    Okay, this is gonna be long, so watch out!

    Quote Originally Posted by paulm View Post
    the time_out page and error message is a bit confusing when clicking checkout after account creation while the cart is empty, I know that is not what the customer is supposed to do but.....).
    Yes, that was why I asked the first question in this thread. If they get to the create_account_success page with an empty cart and click on "continue" (which goes to the checkout_shipping page), they will get a timeout error.

    I was trying to make it so that if the cart was empty, the create_account_success page would not appear and they would be redirected to the homepage or maybe even an alternate create_account_success where there are no "continue" buttons.

    The code that DrByte gave me did not work (but I think our lines got crossed as to what I was trying to achieve). So what I have done instead is...

    my create_account_success page has been altered to appear as if it not a create_account_success page. It's more of a "review the billing info you just entered page, if you were checking out then click here to continue, if you were not checking out, then click here to continue shopping" page. Hopefully if their cart is empty, they will click on "continue shopping" instead of "continue checkout" or they will get the timeout error.

    Quote Originally Posted by paulm View Post
    Then I logged out, created a new account using the same e-mail address and entered a password. Then logged out again and logged into the account. Then I checked my account and I saw the order I placed the first time, when I had not entered a password! Obviously (?) this is not what we want.
    This is what my testing has uncovered..........

    Scenario 1:

    Customer checks out without entering a password.
    They come back another day, checkout using the same email address, and this time enter a password.

    Their account information only shows the address info and order info from the 2nd transaction where they entered a password (like it should).

    This is all fine and dandy because the first time they ordered without entering a password, so that info isn't really supposed to be able to be viewed by them anyway.

    Also, I would probably go into the db once a week and delete the customers who did not enter a password. In fact, is there a way to add to the admin, in the customer section, some type of asterisk or image next to their name that alerts us to whether or not a password was entered. That way we would have to go into phpmyadmin to see if the password field is filled? Then we could delete them directly from the admin.

    Scenario 2:

    Customer checks out with a password.
    Customer comes back, enters same email address as before, but a new password.

    If the customer ever comes back and tries to login, the second password they entered will not work. They can only login with the first password they entered. Now they won't be able to see order info from the second order. If they click on "forgot password" and get a temp password, it logs them into the first account, not the second one.

    Quote Originally Posted by paulm View Post
    A solution could be to let the customers choose if they want to create an account, and add a field to the customers table which stores this preference ("account_created"). And then check for this "account_created" field when a customers uses the same e-mail address a second time.
    This would be wonderful. If only I knew how to code php..... (hint hint!)


    So now I need to wrap my brain around this one! I'm pooped!

    The alternative to all of this is to remove passwords and login altogether, but I'd like to keep it optional. I have shopped at a few sites where there was no "account" and finding out about order status was done through email. I send order confirmations and shipping confirmations via email anyway and don't see a point to an account for purposes of tracking orders. I do see a point to an account for purposes of saving addresses, saving products in the cart, that kind of thing.

    (P.S. I have read EVERY thread on this topic and I don't want anyone to give me any crap about "this is the way Zen works" or "other sites require login", blah blah blah. I am just testing this and learning about Zen, this is not on a live site yet. I myself just want customers to enter a password and be done with it. I believe they should open an account. But unfortunately, not all of them feel this way and the whole point is for them to shop.)

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. Bypass create account success page and go to My Account instead?
    By dealbyethan.com in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Dec 2007, 01:50 PM
  2. Replies: 59
    Last Post: 30 Dec 2006, 05:24 PM
  3. By-pass Account Create Success Page
    By s_mack in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 22 Dec 2006, 02:12 AM

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