Skip to main content

Adding Customer's firstname in Success page Title

Comments

6 comments

  • Karapuz

    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

    https://www.ka-station.com 

    0
  • Nav A

    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
  • Karapuz

    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
  • Nav A

    So do you mean that in the success.twig file, I can do:

    <h1>{{heading_title}}{{text_greeting}}</h1>

    ?

    Regards

    0
  • Karapuz

    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
  • Nav A

    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

Please sign in to leave a comment.

Powered by Zendesk