Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

In Admin/customers.php

If your DOB is set to not required in the Admin settings, then this line of code throws an error when trying to update the customer in Admin.

        $customers_dob = tep_db_prepare_input($_POST['customers_dob']);

Warning: Undefined array key "customers_dob"

approx line 32

Link to comment
Share on other sites

  • Replies 62
  • Created
  • Last Reply

Just wrap that in...

if (is_array($customers_dob) && isset($customers_dob)) {

.....

}

Try it without the is_array() function.

 

 

osCommerce: made for programmers, ...because store owners do not want to be programmers.

https://trends.google.com/trends/explore?date=all&geo=US&q=oscommerce

Link to comment
Share on other sites

This does appear to be a valid problem when you turn the ACCOUNT_DOB setting to false.

I change to:

if (ACCOUNT_DOB == 'true') $customers_dob = tep_db_prepare_input($_POST['customers_dob']);

then everything works fine.

Link to comment
Share on other sites

  • 4 months later...

Hi,

I just started last week to upgrade our osCommerce web shop ( an MS 2.2 version that has been continuously modded, patched and upgraded over the years) from PHP 7.4 to PHP 8.1. For the time being this is only in a test environment (XAMPP). Whilst the corrections to the code  I made so far were more or less straightforward (like described already in this thread), I hit now upon a major problem: Apparently PHP8 does not accept undefined constants anymore. Any occurrence of these result in fatal errors. This leads for instance to the modules not displaying anymore in admin if there are some uninstalled modules amongst those, as the configuration keys for those would not be in the configuration table in the database. When I add some code to the corresponding module script that checks whether the constants are defined before referencing them, I can get the modules displayed in admin, but still I am unable to install the uninstalled modules. I checked the module scripts for the latest version 2.3.4.1, but they are virtually identical to the ones in the older version, that is still relying on the use of potentially undefined constants. I wonder whether anybody has managed to get the modules functions to work with PHP8, and if yes how.

Thomas

Link to comment
Share on other sites

1 hour ago, Thomas789 said:

Hi,

I just started last week to upgrade our osCommerce web shop ( an MS 2.2 version that has been continuously modded, patched and upgraded over the years) from PHP 7.4 to PHP 8.1. For the time being this is only in a test environment (XAMPP). Whilst the corrections to the code  I made so far were more or less straightforward (like described already in this thread), I hit now upon a major problem: Apparently PHP8 does not accept undefined constants anymore. Any occurrence of these result in fatal errors. This leads for instance to the modules not displaying anymore in admin if there are some uninstalled modules amongst those, as the configuration keys for those would not be in the configuration table in the database. When I add some code to the corresponding module script that checks whether the constants are defined before referencing them, I can get the modules displayed in admin, but still I am unable to install the uninstalled modules. I checked the module scripts for the latest version 2.3.4.1, but they are virtually identical to the ones in the older version, that is still relying on the use of potentially undefined constants. I wonder whether anybody has managed to get the modules functions to work with PHP8, and if yes how.

Thomas

You can use these 2 projects as references.

 

Link to comment
Share on other sites

20 hours ago, Hotclutch said:

You can use these 2 projects as references.

 

Thanks, I got it sorted now. I made the mistake not to give an alternative value in case the module constant is not defined, so some of the properties were not defined in modules.php.

By the way the dropbox download of the W3 version only contained empty folders, so I had to check out the Vanilla version.

Thomas

Link to comment
Share on other sites

13 minutes ago, Thomas789 said:

By the way the dropbox download of the W3 version only contained empty folders, so I had to check out the Vanilla version.

I checked the link now and did a download as a not logged in user, and works fine for me.

Link to comment
Share on other sites

  • 2 months later...

Hello @Hotclutch,

I am running a frozen 2.3.4 shop on php7, and would like to upgrade to a higher php version. 

Is it possible to update this version, if so are there a list of instructions to follow? Or do I just need to follow what you have done?

TIA Shaun

Link to comment
Share on other sites

13 minutes ago, RAC said:

Is it possible to update this version

Yes

13 minutes ago, RAC said:

if so are there a list of instructions to follow?

No, there is no complete list anywhere, I am pretty sure.

14 minutes ago, RAC said:

Or do I just need to follow what you have done?

If you want to stay on Frozen and just do php updates, then the best way to go about that would be to look at the W3 osCommerce work that I have done and/or Vanilla osCommerce, and make the required changes to your shop. Bear in mind that this task will be a lot of work and that this thread is not a complete list of updates required.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...