Jump to content
Sign in to follow this  
mmmarcelo

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

Recommended Posts

I am getting many errors using the PHP 7+

PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; ot_total has a deprecated constructor

Not only for the ot_total class but for all files that have functions and class.

Does somebody know a trick how to solve this problem for the new PHP versions?

I have downloaded the latest version of OsCommerce the class it's still the same as my code.

Thank you

Share this post


Link to post
Share on other sites

@mmmarcelo

1) When you say:

29 minutes ago, mmmarcelo said:

I have downloaded the latest version of OsCommerce the class it's still the same as my code.

specifically, *which* version of osC are you using?

2) When you say:

30 minutes ago, mmmarcelo said:

I am getting many errors using the PHP 7+

specifically, *which* version(s) of PHP are you using?

M


Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

If you go to https://www.oscommerce.com/Products you will see two versions listed.  The v2.3.4.1 has the problem that you describe.  The Phoenix Edition v1.0.5.0 is more recent and does not. 

In terms of the specific error that you are encountering, rename a function class_name to __construct.  Phoenix mostly did that in https://github.com/gburton/CE-Phoenix/commit/f059ed430ad632133e43e50111ee5021d41cd10a#diff-b25c7caa707e98de8d250a9375b5c710


Always back up before making changes.

Share this post


Link to post
Share on other sites

Hi,

Thank you for your reply.

I have downloaded the v2.3.4.1 and Phoenix Edition v1.0.5.0.

I am using PHP Version 7.1.33

Is there a way(tutorial) to migrate the version  v2.3.4.1 and make it works with PHP Version 7.1.33?

Thank you.

Share this post


Link to post
Share on other sites
Posted (edited)
5 hours ago, mmmarcelo said:

Is there a way(tutorial) to migrate the version  v2.3.4.1 and make it works with PHP Version 7.1.33?

Development on the 'official' osC v2.3.4.1 release essentially stopped with it's release in 2017. At that time, it was set up to run on PHP versions 5.x. While some people have updated their v2.3.4.1 shops to run PHP v7.x, there has been no official release, nor (to my knowledge) any tutorials to make the upgrade.

Development on the Community Edition continued, with the release of 'Frozen' in 2018 (which, if I remember correctly, did run on PHP v7.x), and the first release of 'Phoenix' in 2019. Phoenix is capable of running PHP v7.x

M

Edited by ArtcoInc

Get the latest Responsive osCommerce CE (community edition) here .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×