Invoice on Checkout_success

Problem updating to work on 1.0.8.20 - Invoice on Checkout_success

Problem updating to work on 1.0.8.20

by 14Steve14 » Tue Sep 05, 2023 11:40 am

I am trying to get this addon to work with 1.0.8.20 and am struggling getting the button code correct. The current code is throwing two erros at tep_draw_button and tep_href_link

Currently the button code is

Code: Select all

  <?= tep_draw_button(MODULE_CONTENT_CHECKOUT_SUCCESS_INVOICE_PUBLIC_TITLE, 'fas fa-file-invoice-dollar', tep_href_link('invoice.php', 'oID=' . (int)$GLOBALS['order_id']), null, ['newwindow' => true], 'btn-primary btn-block mr-2'); ?>
But when I change it to

Code: Select all

<?= new Button(MODULE_CONTENT_CHECKOUT_SUCCESS_INVOICE_PUBLIC_TITLE, 'fas fa-file-invoice-dollar', $Linker->build('invoice.php', 'oID=' . (int)$GLOBALS['order_id']), null, ['newwindow' => true], 'btn-primary btn-block mr-2'); ?>
The page does not work. I must be missing something easy but I cannot see where the problem is. can you help please.
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Contact:

Re: Problem updating to work on 1.0.8.20

by Kofod95 » Thu Sep 07, 2023 10:31 am

Sorry for the late reply!

The button is constructed here: https://github.com/CE-PhoenixCart/Phoen ... on.php#L20

That means the order has to be: text, icon, style, params, link.
The old function had the order as: text, icon, link, something-i-forgot, params, style.

Also the $Linker-build() takes an array as the second argument

Code: Select all

$Linker->build('incoice.php', ['oID' => (int)$GLOBALS['order_id']]) 
I should find some time to release an update for this..

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Contact:

Re: Problem updating to work on 1.0.8.20

by ArtcoInc » Thu Jul 31, 2025 3:52 pm

(installed on Phoenix 1.1.0.3)

1) This add-on creates the invoice dynamically ... nothing is saved. There is no unique invoice number generated nor saved.

2) In addition to having a 'Show Invoice' button at 'Checkout_Success', it also creates a 'Show Invoice' button in the customer's Order History page.

While there is the option to disable the add-on, and even un-install it, if disabled (or un-installed), while the 'Show Invoice' button no longer shows at 'Checkout_Success', it STILL Shows on the customer's Order History page.

Is there a way to completely remove the add-on, without having to manually delete all of the files?

Malcolm
ArtcoInc
Contributor
Posts: 119
Joined: Fri Oct 25, 2019 4:19 pm
Phoenix Version: v1.0.3.0
Contact:

Re: Problem updating to work on 1.0.8.20

by Kofod95 » Thu Jul 31, 2025 6:21 pm

I use the bundler, so didn't think of that.

The button on the customers orders history is added in the override template (I think it's: templates/override/includes/pages/account_history.php). Delete that file, or add an if-statement to disable the invoice-button when the module is not active.

Regarding the dynamic creation: Yes, that's what I needed. It would be possible to create and save files with invoices, but for us that would be a lot of unnecessary storage. Adding a unique invoice-number wouldn't be too difficult, but not something we need either, so it's not included.
You are most welcome to start at thread with a wish list, if you want. I won't guarantee that I will adhere to it, but it's possible I might :)

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Contact: