Page 1 of 1
Show order number on checkout success page
Posted: Fri Oct 15, 2021 9:11 am
by 14Steve14
Is there a way to show the customers order number on the checkout_success.php page.
I looked back to an older version of my store that was pre phoenix days and I added the following to the code
Code: Select all
echo MODULE_CONTENT_CHECKOUT_SUCCESS_TEXT_YOUR_ORDER_NUMBER .' ' .$orders['orders_id'];
I can get it to show the text, but not the order number so something must have changed somewhere. Can anyone help.
Re: Show order number on checkout success page
Posted: Fri Oct 15, 2021 9:30 am
by ecartz
https://github.com/CE-PhoenixCart/Phoen ... _order.php shows
https://github.com/CE-PhoenixCart/Phoen ... uccess.php shows
Code: Select all
$order_id = $orders['orders_id'];
So
should work if done in the proper place.
If it's not working, try the $GLOBALS version. If that's still not working, we need more information about what you are trying to do. In particular, where are you trying to put that code? Inside a module or hook? In the template file?
Re: Show order number on checkout success page
Posted: Fri Oct 15, 2021 10:08 am
by 14Steve14
ecartz wrote: ↑Fri Oct 15, 2021 9:30 am
If it's not working, try the $GLOBALS version. If that's still not working, we need more information about what you are trying to do. In particular, where are you trying to put that code? Inside a module or hook? In the template file?
Should have mentioned where I wanted the order number to show.
Testing on a Phoenix 1.0.7.11 store and adding code into the includes/modules/content/checkout_success/tpl_cm_cs_thank_you.php.
I have added the text into the correct matching file in the languages files
Here is the code where it wants to be added
Code: Select all
<div class="list-group list-group-flush">
<?php
echo sprintf(MODULE_CONTENT_CHECKOUT_SUCCESS_TEXT_SEE_ORDERS, tep_href_link('account_history.php', '', 'SSL'));
echo sprintf(MODULE_CONTENT_CHECKOUT_SUCCESS_TEXT_CONTACT_STORE_OWNER, tep_href_link('contact_us.php'));
?>
</div>
Hopefully I will be able to then copy this new and updated file to the overwrite file once its working.
Re: Show order number on checkout success page
Posted: Fri Oct 15, 2021 11:03 am
by raiwa
Then you should use the $GLOBALS version and better put it in the template file, not the language file.
Re: Show order number on checkout success page
Posted: Fri Oct 15, 2021 1:15 pm
by 14Steve14
raiwa wrote: ↑Fri Oct 15, 2021 11:03 am
Then you should use the $GLOBALS version and better put it in the template file, not the language file.
It is planned to put it in the template file.
Re: Show order number on checkout success page
Posted: Tue Oct 19, 2021 4:29 pm
by 14Steve14
Got this working using the globals option. Just got to pretty up the page now a bit. Thanks for the help @ecartz