Help to update an addon to 1.0.8.20

Open to all! Ask other shopowners for help.
Post Reply
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Help to update an addon to 1.0.8.20

Post by heatherbell »

Trying to update the following line to work in 1.0.8.20:

Code: Select all

        $contents[] = ['class' => 'text-center bg-white', 'text' => tep_draw_bootstrap_button(IMAGE_EMAIL, 'fas fa-paper-plane', tep_href_link('recover_carts.php', 'page=' . (int)$_GET['page'] . '&cID=' . $cInfo->customers_id . '&action=email'), null, null, 'btn-warning mr-2') . tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', tep_href_link('recover_carts.php', 'page=' . (int)$_GET['page'] . '&cID=' . $cInfo->customers_id . '&action=delete'), null, null, 'btn-danger')];
Have tried the following without success:

Code: Select all

        $contents[] = ['class' => 'text-center bg-white', 'text' => $Admin->button(IMAGE_EMAIL, 'fas fa-paper-plane', $GLOBALS['Admin']->link('recover_carts.php', 'page=' . (int)$_GET['page'] . '&cID=' . $cInfo->customers_id . '&action=email'), 'btn-warning mr-2') . $Admin->button(IMAGE_DELETE, 'fas fa-trash', $GLOBALS['Admin']->link('recover_carts.php', 'page=' . (int)$_GET['page'] . '&cID=' . $cInfo->customers_id . '&action=delete'), 'btn-danger')];
Any pointer gratefully received.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Help to update an addon to 1.0.8.20

Post by Kofod95 »

Code: Select all

 $contents[] = ['class' => 'text-center bg-white', 'text' => $Admin->button(IMAGE_EMAIL, 'fas fa-paper-plane', $GLOBALS['Admin']->link('recover_carts.php', ['page' => (int)$_GET['page'], 'cID' => $cInfo->customers_id, 'action' => 'email']), 'btn-warning mr-2') . $Admin->button(IMAGE_DELETE, 'fas fa-trash', $GLOBALS['Admin']->link('recover_carts.php', ['page' => (int)$_GET['page'], 'cID' => $cInfo->customers_id, 'action' => 'delete']), 'btn-danger')];
?

Parameters have, generally, been cleaned up into arrays

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Help to update an addon to 1.0.8.20

Post by heatherbell »

Kofod95 wrote: Fri Dec 23, 2022 5:40 pm Parameters have, generally, been cleaned up into arrays
Many thanks, tried that but the same problem exists, that is, that code results in the links for the buttons to be wrong.
That is, the IMAGE_EMAIL, 'fas fa-paper-plane' button shows href="btn-warning mr-2" and the IMAGE_DELETE, 'fas fa-trash' button shows href="btn-danger"
Looked again at core file examples e.g. https://github.com/CE-PhoenixCart/Phoen ... 5D-%3Elink
So then changed the position of the style code so the line is changed to:

Code: Select all

     $contents[] = ['class' => 'text-center bg-white', 'text' => $Admin->button(IMAGE_EMAIL, 'fas fa-paper-plane', 'btn-warning mr-2', $GLOBALS['Admin']->link('recover_carts.php', ['page' => (int)$_GET['page'], 'cID' => $cInfo->customers_id, 'action' => 'email'])) . $Admin->button(IMAGE_DELETE, 'fas fa-trash', 'btn-danger', $GLOBALS['Admin']->link('recover_carts.php', ['page' => (int)$_GET['page'], 'cID' => $cInfo->customers_id, 'action' => 'delete']))];
This seems to be working now.
User avatar
Kofod95
Senior Contributor
Posts: 748
Joined: Sat Feb 06, 2021 7:38 pm
Phoenix Version: 1.0.8.20
Has thanked: 99 times
Been thanked: 179 times

Re: Help to update an addon to 1.0.8.20

Post by Kofod95 »

Oh yes, I can never remember the order of what goes where.. I always just copy a core-button (or link, or form or whatever) and rename :lol:
Glad you got it working!

//Daniel
I'm not smart, but sometimes even a blind chicken can find a corn.
Here are a lot of corns: Phoenix user guide
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Help to update an addon to 1.0.8.20

Post by heatherbell »

Now found another issue, similar problem with this line that is failing to give the right href:

Code: Select all

      $contents[] = ['class' => 'text-center', 'text' => $Admin->button(IMAGE_DELETE, 'fas fa-trash', 'primary', 'btn-danger mr-2') . $Admin->button(IMAGE_CANCEL, 'fas fa-angle-left', 'btn-light', $GLOBALS['Admin']->link('recover_carts.php', ['page'=> (int)$_GET['page'], 'cID' => (int)$cInfo->customers_id]))];
Changed to:

Code: Select all

      $contents[] = ['class' => 'text-center', 'text' => $Admin->button(IMAGE_DELETE, 'fas fa-trash', 'btn-danger mr-2', $GLOBALS['Admin']->link('recover_carts.php', ['page'=> (int)$_GET['page'], 'cID' => (int)$cInfo->customers_id, 'action' => 'deleteconfirm'])) . $Admin->button(IMAGE_CANCEL, 'fas fa-angle-left', 'btn-light', $GLOBALS['Admin']->link('recover_carts.php', ['page'=> (int)$_GET['page'], 'cID' => (int)$cInfo->customers_id]))];
Now seems to be working :D


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