I am a designer, a blogger and a Wordpress nut!

Subscribe to my Feed
Back to top

50 Responses to WPEC Login Registration Enhanced

  1. Jacob says:

    Awesome idea. Thanks for the tip!
    I read a comment at: http://getshopped.org/forums/topic.php?id=14158 that said you have a solution to make a variation a checkbox instead of a drop down. Is this a simple fix?

    Thanks.

  2. You are a star! Seems a strange floor in the plugin not to have this functionality in the first place

  3. macfocus says:

    Hi, Sounds great, but I am missing something.

    You state: After you have opened up the checkout template php file, just before the “Loop” insert this snippet.

    I can’t find the file you mention. (must be me ; ))

    Just using the default shop theme.

    If you can point me to the right direction, I would be most happy.

    • Roy Ho says:

      You have to create a custom template for that page. Have a look on the WordPress Codex and search for custom page template. It will show you have to create one if you don’t already know.

  4. macfocus says:

    Hmm, I tried to understand how to create my own custom template.
    I failed ; )
    I copied the “user-log.php” file and added your code snippet, (on top of all other code, hope that that is OK).

    If I understand well I have to link to that .php file in one of the visible pages.
    Since the original page uses a shortcode I wasn’t exactly surehow to do that correct.

    That’s just me, not understanding what I am doing (not a programmer by any means.)

    If someone feels like explaining on noob level, please do ; ).

    • Roy Ho says:

      The template has nothing to do with WPEC, its a WP thing. So I suggest to look on the WP Codex as it shows you exactly what to do. If you still don’t understand, I would suggest hiring a professional to implement this for you.

  5. Carly says:

    Hi there, just wondering how this will autofill the customers billing fields, unfortunately this isn’t happening even though they are logged in and have previously filled out billing details.

    thanks.
    Carly

    • Roy Ho says:

      Hi Carly,

      WPEC plugin is responsible for the detail of the logged in user not the script I provided. But at the time I wrote that tutorial, it was working. I am assuming the later versions broke that functionality. Are you also using the latest version of WPEC?

  6. Gonçalo says:

    Hi,
    First, thanks for all your posts. some of them already helped me a lot!

    I’ve read the “create a custom template page” but I still haven’t really figured out where should i insert your code.

    Can you point me out in the right direction?

    Tks. G

    • Roy Ho says:

      Hi Goncalo,

      Have you already created a custom template page for checkout and selected it on the checkout page in the backend?

    • Donna says:

      Hi Roy,

      I’m sorry, but I am still confused and pointing me towards the same page doesn’t clarify anything. The confusion is mainly with the checkout.php file – is it just a file with the code written above or something more? Where exactly is the loop for the checkout.php file? What is the exact name of the checkout template file? And where should I place it (i.e. which folder)? Could you possible post it on this website so we could understand better?

      Thanks,
      Donna

      • Roy Ho says:

        Donna,
        It seems you don’t have a very strong grasp of how WP works. This article was intended for people who have at least a working understanding of the structure. With that said, it would be very time consuming for me to write every single detail here. This was meant to give you an idea of how it could work.

        The codex page shows everything needed prior to putting my code. You just have to read it very carefully from top to bottom. If any terms that are not familiar to you like “the loop”, type it in the search of the codex and it will show you what that is. These are all WP terms and should be understood prior to doing customized WP work.

        Sorry I couldn’t be of more help…

  7. marie says:

    Thanks a million – this worked perfectly.

  8. Izzy says:

    Hello. Thanks for the code. I can’t seem to get it to work. I am using version:3.7.6.9. I get the following error:
    “Fatal error: Call to undefined function sidebarlogin() in C:\xampp\htdocs\wordpress\wp-content\plugins\wp-e-commerce\themes\Pworks\shopping_cart_page.php on line 11″

    I searched for the sidebbarlogin function and I can’t find it.

    Your help is much appreciated.

  9. Bella says:

    like some of the others, I am stuck on how to create a custom template. This is not very clear. Neither you nor the codex mention if the whole code from the checkout page is copied into the custom template, or not, and where the actual code for the checkout page is to begin with. I know you suggested outsourcing this, but no one else seems to be very clear either. This is obviously an easy solution for you and some others, so I’m not sure what I’ve missed. I’d really appreciate it if you could offer a little more detail. Thanks so much.

    • Roy Ho says:

      No, WPEC and WP pages has nothing to do with each other. So you don’t copy the whole code from your checkout page. The Codex should have been very clear on how to create custom templates. You can duplicate the page.php and rename it to checkout.php and change the template name inside the file and then you apply the changes I’ve mentioned in the post.

  10. Bella says:

    Brilliant. it was this page.php clue that I had missed. This detail of taking page.php and making that the template, that was where I was stuck. Thankyou ;)

  11. mihaiteo says:

    Hello.

    First I want to thank you for this feature. I am using wp-ecommerce 3.7.7 with wordpress 3.0.1. Well my problem is this:

    This version of wp-ecommerce provides in the checkout page a login form, however I implement your version of login in the checkout page. I also created a custom checkout template. Nevermind, when i place an order from my computer i fill the personal information and shipping details. When i log-in from a different computer with the same username and password (of course :) ), to place another order, those details aren’t there. I can’t find the solution for this problem.

    The web adress is http://www.webacademy.ro/colportaj

    I look forward to hear from you!

    • Roy Ho says:

      Hi mihaiteo,

      Unfortunately this is a feature of WPEC and does not have anything to do with the code I’ve shown. But I do remember it working with older versions of WPEC when I created this tutorial.

      • mihaiteo says:

        Hey Roy.

        I know that my question wasn’t related to your topic, but i asked you because no one on the getshopped.org forum respond.

        Anyways thanks for the post, and if you have any idea with my problem i would be grateful.

        Best regards!

  12. Bella says:

    Hello Roy,
    Thankyou for your help.
    unfortunately my site is built in Thesis so there is no page.php page. Which is also why I have been chasing my tail. I have created a custom Thesis page, created a hook in the custom_functions.php page. Do you know, should your script work the same way in this custom_functions.php file? ie. the snippet before the loop?
    I was wondering if you would mind just giving me a hint to indicate if the code below looks right to you or where it’s wrong? I am really trying to get this login solution to work. Can I pay you to implement it for me?
    Thanks.

    //custom page template————————————————-

    function isabellas_custom_function(){ // YOU CAN NAME THIS FUNCTION ANYTHING, but it must match the name on line 108
    if (is_page(‘checkout’)) //IMPORTANT———-INSERT CORRECT PAGE NAME HERE

    echo “\t\t\n\n”;
    thesis_hook_before_content(); #hook
    if ( is_user_logged_in() ) : ?>
    (Hi, user_login; ?>)
    <a href="” title=”Log out of this account”>Log out

    <?php
    $loop = new thesis_loop(); // HERE'S WHERE THE LOOP STARTS
    thesis_hook_after_content(); #hook
    echo "\t\t\n\n”;
    thesis_sidebars();
    }

    remove_action(‘thesis_hook_custom_template’, ‘thesis_custom_template_sample’);
    add_action(‘thesis_hook_custom_template’, ‘isabellas_custom_function’); //IMPORTANT!! — same function name from line 91 here
    //—— UPLOAD THIS FILE AND SELECT Custom Template from the drop down on the Edit Page page.

    //end custom page template———————————————-
    ?>

  13. The code proposed in this post is incomplete. $current_user will be an empty variable unless you do this:

    $current_user = wp_get_current_user();

    .. right after if ( is_user_logged_in() ) : .

    • Roy Ho says:

      No, that is not true because $current_user has already been assigned elsewhere and you can freely use it. Try it for yourself and see…

      • $current_user was null here until I added $current_user = wp_get_current_user();

        Admittedly, global $current_user works too. That wasn’t anywhere in my shopping_cart_page.php until now. But thanks, that’s easier than re-retrieving it.

        • Roy Ho says:

          Normally yes I would agree that a created variable not assigned anything would be null but in this case, it has been assigned globally. So if you put that snippet of code anywhere in WP and logged in, you will see that it does pull out the current logged in user name.

          • And I’m telling you it doesn’t return anything in shopping_cart_page.php until I either make it global there, or re-retrieve it. :-)

            I’ve seen before in PHP that it’s necessary to redeclare a variable as global in a template file before you can access it.

          • Roy Ho says:

            Right I heard you and is the first time I’ve heard this…it works perfectly fine on my end without re-declaring it. No one has yet to tell me it doesn’t pull the user name out…strange…

          • tonyblade says:

            Hey, I have the same problem.. WP 3.1.2 – the soultion from Joris is working though.

  14. paul says:

    can i just say that its amazing how much you respond to your comments? kudos for that my friend.

    I must admit that many of peoples frustrations are with wpec and not with you I think. Most of us are not hard core php developers and really rely on copy, paste and modify to get most of our work done…

    i wish that i could have the form auto-populate from the user data. I wonder why this is not happening anymore in the current version of wpec. What version are you running where it does work?

    • Roy Ho says:

      Hey Paul,

      Yeah I provided this code back several versions ago and it used to work as you described. I have recently heard it didn’t work anymore as well. I have seen post on getshopped.org forum that has a solution for this though. But if you really think about it, it isn’t that hard to populate the fields on login. Perhaps I should write a tutorial to do so…

      • paul says:

        if you write a good tutorial, then I will be looking for your paypal donate button…

        the forums are frustrating to scour through.. seems like someone needs to do a wpec roundup of tips and tutorials from the forum.

      • ricky says:

        hi roy, like many other users, i too cannot find a way to have the checkout fields auto-populate and was wondering of you could point me in the right direction as to where i can find the instructions on how to do this. thus far i haven’t had any luck in the forums.
        thanks again for all your knowledge and support!
        r

  15. ricky says:

    Hi Roy,
    I just noticed there seems to be a problem when I have the Login With AJAX widget active on the right sidebar, it basically does not allow the checkout page login form (created as per your specifications) to recognize the user login credentials and generates an error message saying something like ‘invalid user name and password’. Is anyone having the same problem and/or found a solution to allow both the sidebar widget and checkout page form?
    Tnx,
    R

  16. Ed says:

    Hello Roy, great article and a big thanks for doing this – really shocked WPEC doesn’t come with this?!

    I’ve yet to try this feature on the latest version of WPEC, do you know if it still works and is safe/stable to use or will you require a code update?

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*