LemonStand Forum: New user registration - bypassing confirmation email - LemonStand Forum

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

New user registration - bypassing confirmation email

#1 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 06 May 2010 - 06:59 PM

Hi there,

I am wondering if it is possible to bypass the registration confirmation email for new users.

Essentially the first page/part of the order process would include getting details related a new user account, Name - email - password from which they go straight into their order. No confirmation email or logging in.

Is this possible?

the reason is I don't want customers to have to leave the shopping funnel whilst they are in the middle of an order.
0

#2 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 07 May 2010 - 11:46 PM

Hi, mote!

There is one issue with the approach you proposed. To log in (even in the background) a customer should be marked as registered in LemonStand. Also, there could be no multiple registered customers with a same email address. It means - if a customer ordered something on your website, he will not be able to order something else using the same email address, without logging in, because the system will not allow to create another registered customer with a specified email address.

What do you think about the following solution? When customer places his first order, the system sends him a confirmation email with email and password. Into the email message template you will add a note that the next time when the customer want to purchase items on your store, he must login using the email and password specified in the confirmation email message. Also the system automatically logs the customer in. When the customer pays the order, he is redirected to the order details page, with the download links.

Next time the customer will need to log in before placing an order, but he will be aware about the process from the previous experience.

What do you think?

Aleksey

#3 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 08 May 2010 - 01:43 AM

Ah yes that is a very valid point. Also a very good solution!

Where would the best place be to read up on the best way to approach this solution?

Thanks again!

Glyn
0

#4 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 08 May 2010 - 05:26 PM

Hi, Glyn!

This approach is not documented yet. :-) I will provide you with all necessary information here.

First, you need to add a hidden field register_customer to the last step of the checkout process. This page or partial contains the Pay button. If you use the default store checkout implementation, the partial name is shop:checkout_review. Add the following line above the Pay button:

<input type="hidden" name="register_customer" value="1"/>

This will force LemonStand to register customers after placing new orders. Also, we need to auto-login a new customer after placing an order. To login a new customer on new order, we need to process the shop:onNewOrder system event. To process events, a simple module needed. I created this module for you (find it attached). Unzip the archive to the /modules directory. I also published a minor API update, so please update your copy.

The module contains only a few lines of code. It handles the shop:onNewOrder event and executes the following code on each new order:

$order = Shop_Order::create()->find_by_id($order_id);
if ($order)
    Phpr::$frontend_security->customerLogin($order->customer_id);


This code logs the new customer into the store in the background.

You will also need to develop the pages for logged-in customers - the order list and the order details (you can find necessary information in the Wiki - http://lemonstandapp...r_orders_page/, http://lemonstandapp...details_page/). And the last thing you need - when a customer pays an order, LemonStand automatically redirects him the receipt page. Instead of this, we will need to redirect him to the order details page (http://lemonstandapp...r_details_page/). It is a very simple operation, I will explain you how to do it when you are ready.

Thanks!

Aleksey

#5 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 08 May 2010 - 06:26 PM

Aleksy, thank you!

I will go through this early this week and post results :)

Such prompt help, Thank you!
0

#6 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 09 May 2010 - 06:55 PM

Just a point of clarification - will it be possible to to continue using the one-step checkout, ie add the new register_customer input to one_step_checkout_preview page?

Or will I need to sue the guest checkout ..
0

#7 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 09 May 2010 - 07:26 PM

Hi!

This method should work anywhere. In any case it will be possible to update the core, if we face any issues :-)

Aleksey

#8 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 04:25 AM

OK, great instruction - this is what I have done so far

I have added the register_customer code to my Order Preview page

Installed the Module in a folder called motecustommodule

I have created two new pages /order (customer_orders_page) and /orders (order_details_page)

Now things seem to be happening, after selecting "Pay" an order (and when use an email that I have used before) it says that this email is already in use. I then enter an alternative email and it progresses fine. However I can't see the alternative email getting added to the system as a customer?

Also I get an email at this point notifying me of a successful order. I would have assumed this to come after a paypal payment has gone.

I also need to set the return page to /orde. I can see in Paypal that the return page is /ls_paypal_autoreturn - is this the one I change?
0

#9 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 04:38 AM

Oh Hang on I see that the customer is added as a "customer" not a "user" in the CMS , my mistake.
0

#10 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 04:44 AM

OK Do I add the order redirect in the Payment options screen? I think I have this working however I am getting an Order not FOund error, I will keep looking.
0

#11 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 04:46 AM

OK I am getting somehwere!

After a successful payment I am now directed back to the /order page, it does say "order not found" but if I then select "my orders", the order is there.

I can then select that order and download the file.

So I now just have to sort out why the the order is not shown on the initial load.
0

#12 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 10 May 2010 - 02:00 PM

Hi, Glyn! :-)

You already solved almost all tasks. Good job!

To return a customer to the Order page after the successful payment you need to update your receipt page. You should not change anything in the PayPal payment module code, of course. You should already have the receipt page in your store as it is installed by default. On the payment method configuration form (Shop/Payment Methods/Edit) you need to select the receipt page in the Receipt Page field (see the screenshot attached - receipt_page.png).

After that, you need to add two lines of code to the receipt page, in order to redirect a customer from the receipt page to the order page, in the background. Please add the following lines to the Pre Action Code field of the Edit Page form (for the receipt page):

if ($order)
  Phpr::$response->redirect(root_url('/order/'.$order->id));


The code assumes that your order details page has the /order URL. Change it if this is not so. I attached a screenshot - receipt_code.png

Aleksey

#13 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 07:30 PM

Hmmm, I am getting an undefined variable: order error in the pre action on the thankyou page.

I have attached a screenshot. Does this mean I am not passing the order number over from PayPal?
0

#14 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 07:33 PM

Or perhaps is my module not working?
0

#15 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 10 May 2010 - 07:36 PM

Quote

Or perhaps is my module not working?


Hmm... No, I don't think so. What is the URL of a page, which displays you the error? There should be an order number in the last segment of the URL. For example: http://mysite.com/th...u/1231313123123

Aleksey

#16 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 10 May 2010 - 07:40 PM

Glyn, I just added your contact to Skype. If you want, you can come online and I will help you.

#17 User is offline   mote 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 69
  • Joined: 17-February 10

Posted 10 May 2010 - 08:42 PM

Thanks Aleksy, for the help on Skype. So quick and so helpful :)
0

#18 User is offline   mitchkramez 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 84
  • Joined: 26-February 10

Posted 27 August 2010 - 08:46 AM

For clarification - If the user comes back and places another order and doesn't login, but checks out as guest again, I assume that the system wouldn't create a new user account in that case since the email address already exists as a user?
0

#19 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,330
  • Joined: 31-October 09

Posted 27 August 2010 - 04:41 PM

Hi, Mitch!

No, LemonStand will create a guest customer. It does not make assumptions based on the email address. If a customer wants to checkout under his account, he needs to log in. Until customer is authorized with his email and password, he is a guest. However, you can update the checkout process with a simple check - if a customer specifies an existing email on the Billing Information checkout step, you can disallow him to continue and ask him to log in. Let me know if you need help with this.

Thanks.

#20 User is offline   mitchkramez 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 84
  • Joined: 26-February 10

Posted 01 September 2010 - 08:54 AM

Aleksey,
This is working well, however, I never received the confirmation email telling me my (temporary) password. Shouldn't it have sent that out?

I'm wondering if there's a way to allow the user to choose a password in the checkout process somewhere?
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users