Ship2pay in Phoenix

Ask the community for help and support.
driven22
Posts: 8
Joined: Sun May 30, 2021 2:40 pm

Ship2pay in Phoenix

Post by driven22 »

I have some problems with adaptation Ship2pay to Phoenix. I need help
Notice: Undefined index: action in /xxxxx/admin/ship2pay.php on line 44

Code: Select all

if ($_GET['action']) {
    switch ($_GET['action']) {
Notice: Undefined index: action in /home/xxxxx/admin/ship2pay.php on line 153

Notice: Undefined variable: trInfo in /home/xxxxx/admin/ship2pay.php on line 178

Code: Select all

153     switch ($_GET['action']) {

178      if (is_object($trInfo)) {
I have a lot problems with ship2pay. After many years, I changed from 2.3.4.1 and I am slowly just beginning to orient myself in the changes.
driven22
Posts: 8
Joined: Sun May 30, 2021 2:40 pm

Re: Ship2pay in Phoenix

Post by driven22 »

Ok i changed :if ($_GET['action']) {
to
if (isset($_GET['action'])) {

and the error " Undefined index: action in" is not displayed. The rest to be repaired. COD still doesn't work
Omar_one
VIP Member
VIP Member
Posts: 481
Joined: Fri Oct 25, 2019 5:06 pm
Has thanked: 48 times
Been thanked: 27 times

Re: Ship2pay in Phoenix

Post by Omar_one »

@driven22
I had it working on early versions of Phoenix with fixed by @ecartz as you saw it on the old forum, overriding the payment.php ..
and I had on that time one issue still,(I can't delete the records as the delete button disappear - sure it's a mistake by me) .. I will check it again on 1.0.8.5 if its working.

@BrockleyJohn do you have an input?
BrockleyJohn
PhoenixCart Developer
PhoenixCart Developer
Posts: 31
Joined: Mon Mar 01, 2021 5:37 pm
Been thanked: 1 time

Re: Ship2pay in Phoenix

Post by BrockleyJohn »

If I remember right the admin page was an osc 2.2 file that had only been minimally changed to work with 2.3

I tidied it up a little but it's likely to be fairly dodgy on all the bootstrapped admin and even worse on recent - will probably throw lots of deprecated notices I should think.

It also predates the class autoloading and the files as delivered will be out of step with the latest classes.

The implementation in checkout could perhaps use a rethink now but it may be that we can patch it as is for now.
driven22
Posts: 8
Joined: Sun May 30, 2021 2:40 pm

Re: Ship2pay in Phoenix

Post by driven22 »

After two days of rework, it started working. When I turn on error reporting on the server, a lot of them are displayed (but somehow it works). Unable to run the delete - tried various changes, but for now I have to do it via phpMyadmin. Phoenix was terribly complicated, simple files separated into a dozen smaller ones scattered in many places.
driven22
Posts: 8
Joined: Sun May 30, 2021 2:40 pm

Re: Ship2pay in Phoenix

Post by driven22 »

On shop side i have this error/notice:
Notice: Undefined index: in /home/xxx/sklep_phoenix/includes/classes/ship2pay.php on line 33
file includes/classes/ship2pay.php:

Code: Select all

  
32  function get_pay_modules($ship_module){
33    return $this->modules[$ship_module];
34   }
35   }
Can you help me with this ?Admin side is OK.
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: Ship2pay in Phoenix

Post by loop »

Hi all
any news on this?
i would love to integrate this (my concern is primary the SHOP SIDE without overwriting the checkout_payment.php)
i would like to know if there is a smart / nice way to use ship2pay without changing core...
thanks in advance!
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: Ship2pay in Phoenix

Post by loop »

require('includes/classes/ship2pay.php');
$my_ship2pay = new ship2pay;
$arrship=explode('_',$shipping['id']);
$ship2pay_mods = $my_ship2pay->get_pay_modules($arrship[0]);
if (tep_not_null($ship2pay_mods)) {
$this->modules = explode(';', $ship2pay_mods);
} else {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
}
this is the part which should be in the payment.php but i don't know how to do that with hooks....
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Has thanked: 38 times
Been thanked: 102 times

Re: Ship2pay in Phoenix

Post by raiwa »

make a copy of the payment class into includes/system/override/ship2pay/
(where shp2pay is just to have it somehow organized, it's not critical)
and apply the modifications to this copy.

remember that

Code: Select all

tep_not_null($ship2pay_mods)
is deprecated. Possibly replace by

Code: Select all

!empty($ship2pay_mods)
or

Code: Select all

[] !== $ship2pay_mods
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
loop
VIP Member
VIP Member
Posts: 230
Joined: Thu Mar 25, 2021 12:26 pm
Has thanked: 7 times
Been thanked: 3 times

Re: Ship2pay in Phoenix

Post by loop »

hi Raiwa
okay...you think / know there is no "nice" hook solution without overwriting?
Post Reply