Show order number on checkout success page

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Show order number on checkout success page

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Show order number on checkout success page

Post by ecartz »

https://github.com/CE-PhoenixCart/Phoen ... _order.php shows

Code: Select all

$GLOBALS['order_id']
https://github.com/CE-PhoenixCart/Phoen ... uccess.php shows

Code: Select all

  $order_id = $orders['orders_id'];
So

Code: Select all

$orders['orders_id']
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?
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Show order number on checkout success page

Post 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.
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Show order number on checkout success page

Post by raiwa »

Then you should use the $GLOBALS version and better put it in the template file, not the language file.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Show order number on checkout success page

Post 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.
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Show order number on checkout success page

Post by 14Steve14 »

Got this working using the globals option. Just got to pretty up the page now a bit. Thanks for the help @ecartz


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply