Adding Customer's firstname in Success page Title
Hi All,
I wonder if someone could help me. I want to be able to add customer's first name ad order ID to my success page.
I have managed to add order ID on the success page (by reading some related forums) but I am struggling to add customer's first name
Basically, on the success page, where the first heading says, Thank you!. I would like to replace that heading with:
Thank you (customer's first name)!
I know I have to modify 2 or 3 of the following files but I am really struggling to get it to work.
\catalog\controller\checkout\success.php
\catalog\language\en-gb\checkout\succcess.php
and probably:
\catalog\view\theme\default\template\common\success.php
I would be grateful for any advise or a working example. Regards
-
Hello, Nav,
I have a video showing how to add an extra information to the checkout success page. It is for Opencart 3, but you should get the idea how it can be made.
https://www.youtube.com/watch?v=QT-AZs1KNJE
Kind regards,
Karapuz
0 -
Hi Karpuz, Thank you for your comment and the video.
However, your video does not cover what I want. I don't want to add (text_greeting) below the heading. Instead, I want customer's first name to appear as part of the title / heading so the heading should say:
Thank you John!
Please let me know if you have a code example file for this? Kind Regards
0 -
Hello, Nav,
You can use the prepared variable in other places, i.e. inside <h1> tag or define as a page title:
$this->document->setTitle($data['text_greeting']);
Kind regards,
0 -
So do you mean that in the success.twig file, I can do:
<h1>{{heading_title}}{{text_greeting}}</h1>
?
Regards
0 -
It is clearer to use this:
{% if order_id %}
<h1>{{text_greeting}}</h1>
{% else %}
<h1>{{heading_title}}</h1>
{% endif %}See my video where I explain order_id.
0 -
Hi Karapuz,
Thanks for your comment. With your help and your video, I have been able to do exactly what I wanted.
Thanks you very much for your time and help.
Regards
Nav
0 -
Superb internet site you've got here however I changed into thinking in case you knew of any community boards that cowl the identical subjects mentioned in this newsletter? I’d virtually like to be a part of community in which I can get recommendation from different knowledgeable people that share the identical with new software.
0 -
Can we please get an update on while a sub-subject matter layer could be brought to the community. It have to be notable simple since you already have the generation with the best skateboard wheels.
0
Please sign in to leave a comment.
Comments
8 comments