Jump to content
haunter

[CONTROLLER] Change guest delivery address

Recommended Posts

Hi, think it belongs here.

 

Our customer has a problem with guest checkout in 5 step order.. Yes, it´s strange in prestashop 1.8.4.2, so I made a workaround to enable to guest change his address(if he made a mistake for example).. In this time, its very, very simple and with lot of restrictions, but I have a lot of work for now, so excuse me, I will upgrade it (if your reactions will be good)

 

v1.0 Restrictions:

Let´s say, that my workaround is in v1.0, this is just code changed to our customer requirements, so its a individual version.

- Gender, country, Birth date isn´t in guest "quick order" form

- Sometimes there are a Czech strings (sorry about that, no time)

- Customer cannot edit invoice address (he can write it into order notes or sign in, I think it isnt so often situation)

- only one phone row

- only one address row

- when the form is pre-filled with browser auto-fill it throws error (because name and surname are in hidden fields and JavaScript will not fill them, so you must manually change that fields and its working)

 

Little about theory:

 

How its working now?

Customer go into cart summary, then (if you have enabled guest checkout of course) he goes into "authentification" where is "quick order" where he fill his address. After submit, address is saved into DB and he is redirected to next step: Addresses.

 

What is strange on it now (in addresses)?

Guest have an option to choose his addresses (but he cannot have any)

Guest can choose an invoice address (how he could add one?)

Guest can add an address.. no, he must be logged in.

Guest have under addressess change link, but he cannot change address.

 

So, what we will do?

If user is not registered, we just hide this ^(What is strange on it now) fields, only what will be visible is change under delivery address. After clicking on it he will be redirected to the "authentification" page with pre-filled fields with his address, he can change them and continue with address changed.

 

If you want detailed technical description, reply.

 

Here are the files:

guest_address_change.zip

 

HOW TO:

1.) Turn on force compile in administration (settings -> performance)

2.) Backup your files

(controllers/AuthController.php, themes/yourtheme/authentication.tpl, themes/yourtheme/order-address.tpl, themes/yourtheme/order-address.js)

3.) Copy new files to server

4.) Check compatibility with your theme and language (maybe you will need to change files)

 

Now it should work, I am heading forward to your replies, hope it will help you and the replies will be motivating to other work ;-)

 

Thank you.

Edited by haunter (see edit history)
  • Like 3

Share this post


Link to post
Share on other sites

Hi haunter,

 

I didn't test yet modification create by you but I must say... why PrestaShop team doesn't make guest customer able to edit his data in 5 step checkout? AND why we are not able to back to the option to change from guest checkout to register checkout after submit guest customer datas? It's really not nice...

 

Many thanks, you did it and share it to us. My company will still support version 1.4 a long time so we also will work on this.

Share this post


Link to post
Share on other sites

After reading of a few topics, the Prestateam replies, that the 5 step checkout is not completely perfect. I thought, that the 1.4.8.2 is the last version of 1.4 and it´s absolutely complete.. Anyway, Prestashop is the best ;-)

Share this post


Link to post
Share on other sites

Hi Haunter,

thank you for your fix tool. But I have got some problem with it. The condition if($je_registrovan) is always false. I think that $je_registrovan, which is used in tpl files is not set in php files. I can't find any assign of $je_registrovan with smarty and tpl.

Thanks.

Share this post


Link to post
Share on other sites

Maybe it's not the right solution, but it works for me - I have used haunter's files and changed OrderController.php (only the Addres step part):

 

/* Address step */
protected function _assignAddress()
{
 parent::_assignAddress();
 self::$smarty->assign('cart', self::$cart);
self::$smarty->assign('je_registrovan' , !(isset(self::$cookie->is_guest) ? self::$cookie->is_guest : 0));
}

 

Now it should work...

Edited by Sir Tom (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

not working, not mention Czech spelings of course

I´m sorry about your problem, but what currently is not working for you? We can fix it if you describe it.

Share this post


Link to post
Share on other sites

i have the same type of problem at the time of order confirmation i can't update or add new address. It shows blank page .how can i solve this ? please help me guys . my client website url is : http://www.intimio.it/
 

post-722820-0-54754800-1383286403_thumb.png

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More