Custom Thank You Page

Phoca Cart - complex e-commerce extension
clausy
Phoca Member
Phoca Member
Posts: 20
Joined: 13 Aug 2017, 03:56

Custom Thank You Page

Post by clausy »

Hi, anyway to customize the (info) / thank you page...
I need to include some info:
order number , date, total, and print/or view order.

thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom Thank You Page

Post by Jan »

Hi, you can override the info page by your template:
components\com_phocacart\views\info\tmpl\default.php

Even the messages can be changed in language strings:

Code: Select all

;[USER SPECIFIC STRINGS IN INFO VIEW - SEE DOCUMENTATION]
COM_PHOCACART_ORDER_PROCESSED_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_PROCESSED_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO=""
There there is no feature to add something as info there, so this needs to be customized directly in the code - get the information about the order and set it to the message which will be sent to the info view :idea:

Jan
If you find Phoca extensions useful, please support the project
clausy
Phoca Member
Phoca Member
Posts: 20
Joined: 13 Aug 2017, 03:56

Re: Custom Thank You Page

Post by clausy »

Thanks but which page need to be customized for getting the information about the order...
Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom Thank You Page

Post by Jan »

Hi, there are more possible ways:

directly in the controller:
components\com_phocacart\controllers\checkout.php (method order() - you can get the infos from model)
or in the payment plugin:
$message = $order->getMessageAfterOrder(); // event in plugin used in the controller checkout
...

Or see e.g.:
plugins\pcp\paypal_standard\paypal_standard.php
function PCPbeforeProceedToPayment(&$proceed, &$message) {

The message can be edited here, so then this message is set before going to payment gateway and returned back to the thank you page.
Jan
If you find Phoca extensions useful, please support the project
simonctl
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 24 Nov 2019, 15:12

Re: Custom Thank You Page

Post by simonctl »

Hi there,
I am sorry, but I do not get it...
I tried to do so in the controller (checkout.php) as well as in the payment-plugin (CashOnDelivery). I understand how I can change the message that is displayed. But how can I include the infos like order number, date and total?
Has someone an example like $odernumber = *** ?
Thanks, Stefan
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom Thank You Page

Post by Jan »

Hi, you need to check the plugin event methods and test the parameters they are sent to them. If the parameters do not include such info you need, you just need to upload them from database completely from scratch :idea:

Jan
If you find Phoca extensions useful, please support the project
simonctl
Phoca Newbie
Phoca Newbie
Posts: 2
Joined: 24 Nov 2019, 15:12

Re: Custom Thank You Page

Post by simonctl »

Perfect. I found the order-ID and everything else can just be found in the database. Thanks!!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom Thank You Page

Post by Jan »

Ok, great to hear it.

Jan
If you find Phoca extensions useful, please support the project
Webguy
Phoca Enthusiast
Phoca Enthusiast
Posts: 62
Joined: 16 May 2024, 15:59

Re: Custom Thank You Page

Post by Webguy »

In most shops I've been using there is an option to set the thank you page to an url of your choosing in the options.

I see this post is quite old, is there already any built in option that can be used or custom solution that won't be overwritten by an update.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48345
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Custom Thank You Page

Post by Jan »

Hi, there is an info view, you can set own description there, even this can be changed by different methods like payment methods. And you can override this view with template override, so the changes will be not lost when updating. :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply