Purchase without Account

Ajax Attribute Manager, osCommerce and PHP8 - Purchase without Account

Ajax Attribute Manager, osCommerce and PHP8

by Mister Woyng » Mon Nov 28, 2022 6:44 am

Hello,

this is a question I have asked already on the OsCommerce Forum, but maybe this here is a better place for that:

Problem: After updating to PHP8 the Attribute Manager throws errors, like this one:
 

Code: Select all

Fatal error:  Uncaught Error: Non-static method stopDirectAccess::authorise() cannot be called statically in .../catalog/admin/attributeManager/includes/attributeManagerPlaceHolder.inc.php:17
I learned that this is a new error in PHP8, and, not being so proficient in advanced OOP, tried a workaround...from

Code: Select all

stopDirectAccess::authorise(AM_SESSION_VALID_INCLUDE);
to

Code: Select all

$stop = new stopDirectAccess();
$stop->authorise(AM_SESSION_VALID_INCLUDE);
but there is still an error, I did it wrong.

Is there a PHP8-Version of the Attribute Manager? If not...what can I do to fix this?

Thanks a lot!
Mister Woyng
Member
Posts: 5
Joined: Mon Nov 28, 2022 6:35 am
Phoenix Version:
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by raiwa » Mon Nov 28, 2022 9:28 am

The newer versions for Phoenix you can download here, work with PHP 8.0.
Sorry, I have no plans to update old Ocommerce versions or to give support for these.
Hope you understand.

If you wish to run PHP 8.0, you should migrate to latest Phoenix.

Best wishes
Rainer
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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by Mister Woyng » Tue Nov 29, 2022 9:50 am

Thank you for your answer.

Yes, of course I understand that.
We have a heavily modified osCommerce-Shop here and were forced to run PHP 8.
Migration is basically impossible. So I was looking for solutions, and i thought I'd find them here...

Is the Ajax Attribute Manager Addon for Phoenix Cart PHP-8-ready? This one:
https://www.phoenixcartaddons.com/free- ... -p-80.html

Thanks :-)
Mister Woyng
Member
Posts: 5
Joined: Mon Nov 28, 2022 6:35 am
Phoenix Version:
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by raiwa » Tue Nov 29, 2022 7:10 pm

Latest version is tested with PHP8.0.You can see all details under Addon details tab.
But it will not work with your oscommerce store.
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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by Mister Woyng » Wed Nov 30, 2022 11:10 am

Thanks.
It seems like I cannot find the Addon details tab. Where is it?
Mister Woyng
Member
Posts: 5
Joined: Mon Nov 28, 2022 6:35 am
Phoenix Version:
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by raiwa » Wed Nov 30, 2022 11:16 am

At the top of this page:

Addon Details Addon FAQ (0) Addon Discussion/Support Edit Addon
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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by Mister Woyng » Thu Dec 01, 2022 8:53 am

OK, thanks.
But when I look at the Addon Page: app.php/addons/free_addon/ajax_attribute_manager,
I see three buttons:

PHP5: NOT SUPPORTED
PHP7: TESTED 7.x
PHP8: NOT TESTED

Looking inside the code I see the same code as in the corresponding osC file:

stopDirectAccess::authorise(AM_SESSION_VALID_INCLUDE);

This will most likely not work under PHP8...or what do you think?
Mister Woyng
Member
Posts: 5
Joined: Mon Nov 28, 2022 6:35 am
Phoenix Version:
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by raiwa » Thu Dec 01, 2022 9:12 am

It will work, I just had no time to update the flags.
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
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Contact:

Re: Ajax Attribute Manager, osCommerce and PHP8

by Mister Woyng » Sat Dec 03, 2022 7:36 am

Hello,

in the osC-Contribution I had fatal errors. The code is the same in the Phoenix Cart Addon, so there is a chance that you will get fatal errors too.
But I could easily fix it:

\includes\attributeManagerPlaceHolder.inc.php:17
replace
stopDirectAccess::authorise(AM_SESSION_VALID_INCLUDE);
with
(new stopDirectAccess())->authorise(AM_SESSION_VALID_INCLUDE);

In osC, you must also fix \includes\classes\attributeManagerConfig.class.php: 122+128:
it must be this:
(new amDB())->query("CREATE TABLE...

Not sure how Phoenix Cart will behave here. But osC needed these 3 fixes, and constructor methods with the same name as the class were renamed to __construct. But it works now :-)
Mister Woyng
Member
Posts: 5
Joined: Mon Nov 28, 2022 6:35 am
Phoenix Version:
Contact: