The Thank You page is used as confirmation that the order was created and payment was received. It's also responsible for sending out confirmation emails, and is where you can hook into the order creation process to perform additional actions.
If the payment failed, the thank you page shows an error to the customer.
The basic code to add to your template or resource content is the following:
That should be sufficient to be able of confirming orders.
&redirectToOnNotFound property will send the customer to the home page if no unfinished order was found in the users' session. You can change this to another page if you'd like.
Success and failure messages
To show the customer what happened with their order, you can add the
&orderFailed properties to the snippet call. Here's an example of what you might add, using an inline chunk.
[[!scFinishOrder? ... &[email protected]:<p>Dear [[+order.firstname]] [[+order.lastname]], thanks for your order. We have send you an e-mail at [[+order.email]] with the order details.</p>` &[email protected]:<p>Unfortunately we couldn't finish your order. Something is went wrong. Please contact us[[+order.ordernr:notempty=` and report your order number: [[+order.ordernr]]`]].</p>` ]]
If your message gets more complex than a single line of text, you'll most likely want to create separate chunks and just add the chunk name to the properties.
[[!scFinishOrder? ... &orderSuccess=`orderSuccessChunk` &orderFailed=`orderFailedChunk` ]]