Jump to content

Guest Checkout and turn guest into customer


spk

Recommended Posts

Heya!

 

I'm using a guest checkout for PS 1.5 and got a couple of questions.

 

If someone uses the guest checkout, how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password.

I'd like the feature because I'd like to rename guest checkout to instant checkout and I don't like to have so many fields for the customer to fill in.

 

I want the function "Turn this guest account into customer" (which is available in the backoffice -> orders) to be executed when someone uses the guest checkout. 

Is there any function I can add to a controller or something?

 

Thanks in advance.

Edited by spk (see edit history)
Link to comment
Share on other sites

there is so little difference between normal one-page check out and guest checkout it makes little sense to me to modify the 'guest' checkout to act like 'regular' checkout.  my two cents

 

Yes, I'm aware of that. But the thing is that its not the "regular" guest checkout, its edited both in design and some validation stuff.

 

So I'm still looking for a way to turn guest into customer when a order is placed.

Link to comment
Share on other sites

Yes, I'm aware of that. But the thing is that its not the "regular" guest checkout, its edited both in design and some validation stuff.

 

So I'm still looking for a way to turn guest into customer when a order is placed.

 

you are aware of change of question? " how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password."

Link to comment
Share on other sites

you are aware of change of question? " how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password."

 

How is this: 

"If someone uses the guest checkout, how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password."

And this:

"So I'm still looking for a way to turn guest into customer when a order is placed."

 

Not the same thing? The e-mail with a generated password is sent out if i convert a guest into a customer manually. And I want this function to be executed when someone places an order using the guest checkout.

Edited by spk (see edit history)
Link to comment
Share on other sites

How is this: 

"If someone uses the guest checkout, how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password."

And this:

"So I'm still looking for a way to turn guest into customer when a order is placed."

 

Not the same thing? The e-mail with a generated password is sent out if i convert a guest into a customer manually. And I want this function to be executed when someone places an order using the guest checkout.

yes, and I suggest, simply turning off guest checkout.

 

if you want to develop a solution then you can use the hook executed at account creation.

 

what  level of development are you comfortable with?

 

and it is the same thing, if you change guest to regular account processing to just generate a regular account that generates welcome with password,  then it is the same thing..jajajaja

Link to comment
Share on other sites

yes, and I suggest, simply turning off guest checkout.

 

if you want to develop a solution then you can use the hook executed at account creation.

 

what  level of development are you comfortable with?

 

and it is the same thing, if you change guest to regular account processing to just generate a regular account that generates welcome with password,  then it is the same thing..jajajaja

 

Alright, now I'm in the game!

 

I see that you think that, but the check out is already done and that's why I'm looking for this. There are a couple of scripts that makes the checkout even faster. It doesn't work if I turn off guest checkout. 

 

I guess I'm kinda comfortable developing stuff, but I've not worked with the check out before.

So editing the hook that creates the account (both customer and guest) is the way to go? I'll check it out.

Link to comment
Share on other sites

Alright, now I'm in the game!

 

I see that you think that, but the check out is already done and that's why I'm looking for this. There are a couple of scripts that makes the checkout even faster. It doesn't work if I turn off guest checkout. 

 

I guess I'm kinda comfortable developing stuff, but I've not worked with the check out before.

So editing the hook that creates the account (both customer and guest) is the way to go? I'll check it out.

 

yes do that, follow the hook, then look at the call of 'transform guest to customer' button, as that code (function call) already exists, I am coming around to your side, this also gets rid of that nasty little issue of duplicate email accounts we see come up every so often.

 

share what you do, as you may be on to something. :)

Link to comment
Share on other sites

Yea I've seen people having that issue too. Which comes with someone using guest check out and then tries to create a regular order later.

 

Nice to hear!  ^_^

 

I'll have a look at it and see how far I get. And post the code if I fix it, if I don't i might need some help.

Link to comment
Share on other sites

Hey again,

 

I took a look at the class Customer.php and found this function:

public function transformToCustomer($id_lang, $password = null)
{
if (!$this->isGuest())
return false;
if (empty($password))
$password = Tools::passwdGen();
if (!Validate::isPasswd($password))
return false;


$this->is_guest = 0;
$this->passwd = Tools::encrypt($password);
$this->cleanGroups();
$this->addGroups(array(Configuration::get('PS_CUSTOMER_GROUP'))); // add default customer group
if ($this->update())
{
$vars = array(
'{firstname}' => $this->firstname,
'{lastname}' => $this->lastname,
'{email}' => $this->email,
'{passwd}' => $password
);


Mail::Send(
(int)$id_lang,
'guest_to_customer',
Mail::l('Your guest account has been transformed to customer account', (int)$id_lang),
$vars,
$this->email,
$this->firstname.' '.$this->lastname,
null,
null,
null,
null,
_PS_MAIL_DIR_,
false,
(int)$this->id_shop
);
return true;
}
return false;
}

As well as controllers/admin/AdminCustomersController.php:

 

public function processGuestToCustomer()
{
$customer = new Customer((int)Tools::getValue('id_customer'));
if (!Validate::isLoadedObject($customer))
$this->errors[] = Tools::displayError('This customer does not exist.');
if (Customer::customerExists($customer->email))
$this->errors[] = Tools::displayError('This customer already exists as a non-guest.');
else if ($customer->transformToCustomer(Tools::getValue('id_lang', $this->context->language->id)))
Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token);
else
$this->errors[] = Tools::displayError('An error occurred while updating customer information.');
}

These are the two functions I've found that seem to be having something to do with the guest to customer transform.

 

The form that triggers the function is this (on the order page in the back office):

<form method="post" action="index.php?tab=AdminCustomers&id_customer=4&token=0e613e15194e17330af75363cd372115">
<input type="hidden" name="id_lang" value="1">
<input class="btn btn-default" type="submit" name="submitGuestToCustomer" value="Transform a guest into a customer">
<p class="help-block">This feature will generate a random password and send an email to the customer.</p>
</form>

 

 

Am I missing some more functions that are important?

Edited by spk (see edit history)
  • Thanks 1
Link to comment
Share on other sites

I don't know if you have built this yes so i will make a few suggestions help getting you started to develop, so you can test your code.

 

build a test shop (use latest native version or your target version), on your computer using a  localhost environment. 

 

then have good development environment set up, use git for example to store your code.  I use dreamweaver 5

 

then you can start to test different ideas you have, and wallah!  your first module.  

Link to comment
Share on other sites

I don't know if you have built this yes so i will make a few suggestions help getting you started to develop, so you can test your code.

 

build a test shop (use latest native version or your target version), on your computer using a  localhost environment. 

 

then have good development environment set up, use git for example to store your code.  I use dreamweaver 5

 

then you can start to test different ideas you have, and wallah!  your first module.  

 

Oh, no thats not my functions. That's the existing ones. 

 

Dont worry about that part, I already got a test-site going on and I'm comfortable with the programming part (PHP). But I'm not one hundred percent sure how to configurate the function to work in Prestashop. I do know the basics of creating a simple module though.

 

What I was wondering was if that's all the functions that are used for transforming a guest into a customer.

Link to comment
Share on other sites

  • 3 months later...

Hi SPK,

 

Just wanted to check if you have been able to proceed any further with this? I wonder why Prestashop is not including this as part of their release. This is very much required. An admin should not be required to perform this manually.

 

Any help in this will be highly appreciated.

 

Thanks,

Vivek

Link to comment
Share on other sites

  • 3 months later...
Hello all,

 

I know this adding to an old post...

 

We would very much like to have an easy automated way to upgrade guests to customers.

 

Since we upgraded to 1.6.9 and introduced guest and 1-page checkout, our orders are almost all from guest accounts. This would be fine except guest have fewer options, which confuses our customers (guests) when dealing with product returns, order tracking etc.

 

In reality the only difference between a guest and a customer is the password, and the reason why guest orders are the most used, is probably because it is perceived as being faster, and some misguided idea that we store less information about the guests, than customers.

 

The problem we’re facing (in addition to duplicate, triplicate guest accounts and confused customers), is that other modules, such as review modules require customer accounts. With fewer and fewer of these, we are finding it harder and harder to socially interact with our customers.

 

We need:

- An easy overview of customer types. Now we have to access each customer individually to see if they are a guest or not.

 

- An easy way to upgrade guests to customers in bulk/automatically. Either upon reaching a certain order status, or via the order confirmation page, or something else very clever.

 

- The developers to consider customer creation without password, making checkout faster. Password could be randomly generated and emailed upon order completion. The check-out process needs to be as simple as possible. Once the order is completed, the buyer is much more willing to accept an account creation. Especially if it is automated and requires no effort on their part.

 

 

We’re looking into using social network sign-in, but have yet to see if that can help convert the numbers of guests to customers.

 

Christian

Link to comment
Share on other sites

  • 1 month later...

hello

Is there someone that have an idé to turn guest into customer automatic when a guest is using the guest checkout.
I have big problems with the checkout, and i need help.

Link to comment
Share on other sites

I would actually be pretty angry about ordering as a guest and then being sent a plain text password and "Thank you for registering at my Shop!" 

 

If you need your customers to register DO NOT enable guest checkout but use (and modify if you need to) the one page checkout. We (hopefully) all know the story of the $300 Million Button but like it says in the article that option is for customers who "[are] not here to be in a relationship". If you do want to be in a relationship with your customers then this is not the way to go...

Link to comment
Share on other sites

  • 2 years later...
On 4.5.2015 at 5:22 PM, El Patron said:

my advice (two cents?)...

 

don't use guest checkout...focus instead on easy to use one page checkout....

Very old post, but I wanted to ask if you still would follow this advice?

What about those customers that purchased a long time ago, and at that time was forced to make a password. Chances are they have forgotten all about their last purchase, and now they are suddenly asked for a password when they enter their e-mail address.

What I think would be the absolutely best solution would be to use guest checkout, for both former registered customers, and new ones. But as soon as the customer has entered their e-mail address, do a quick check on it, and show a small link - "You've been here before, want to log in?"

If the customer doesn't want to log in, they can continue with the guest checkout.

On the order-confirmation / thank you - page, they should be asked: "Want to create a password, so you can log in the next time?" and then give them a password-field and a button that says: "Remember me".

Something like that...

And what would be even better - was if prestashop was able to merge a guest-purchase with a customer-account, if a registered customer checked out as a guest. 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
On 18.09.2014 at 11:22 PM, spk said:

Heya!

 

I'm using a guest checkout for PS 1.5 and got a couple of questions.

 

If someone uses the guest checkout, how do I turn the guest account into a customer account when they make create an order? I want to send out an e-mail with a generated password.

I'd like the feature because I'd like to rename guest checkout to instant checkout and I don't like to have so many fields for the customer to fill in.

 

I want the function "Turn this guest account into customer" (which is available in the backoffice -> orders) to be executed when someone uses the guest checkout. 

Is there any function I can add to a controller or something?

 

Thanks in advance.

 

This one is easy. I also like to test functionality with diffrent modules and use this frequently.

Run this SQL in your PHPMYADMIN or SQL CONSOLE :

UPDATE `ps_customer` SET `is_guest` = '0' WHERE `ps_customer`.`id_customer` = <customer_id>;

where <customer_id> is the number of the desired customer (you can get it from BO Clients table with ID column prefix)

 

Link to comment
Share on other sites

  • 2 months later...

I use this topic, because my problem, i think, is quite similar.

I would like to send an automatic mail, when i change the status of a Customer into another Customer group (not guest to customer, but Customer Group into Customer Group 4,5,6,7...).

 

Any Idea?

Thanks

 

p.s my Presta version in 1.7.2.4

Link to comment
Share on other sites

  • 7 months later...

I would assume this is s a 2015 issue, in 2018/19 I think customers are more likely to want to register and have an account, as more and more shops from my own experience have disabled guest checkout, and customers like to have a portal where they can track their orders and see their purchase history.

Yet I don't know if 1.6 have fixed the issue from 1.5, with duplicate entries etc. in the database, and customers not being able to sign up with the e-mail they once used to guest checkout.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...