Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2.2RC1 and PHP7


stratula

Recommended Posts

Not that would be any less work than upgrading to the latest version:

https://codeload.github.com/gburton/Responsive-osCommerce/zip/master

It’s kinda like asking how you could get Windows 95 working on a brand new tablet - can it be done?.... yes. Should it be done?.... maybe not (I’m sure some would disagree with me)

 

Link to comment
Share on other sites

thank you for quick reply!

But that means that i have to make a complete new shop and there will be almost no addons for latest version even the latest german languages doesn't work with this version.

I think i am in big trouble 

Link to comment
Share on other sites

Software applications "decay" over time, becoming less and less compatible with current systems (e.g., PHP 7). It is your responsibility to keep updated, and not let your application (store) become ancient and out of date. 2.2RC1 is something near 10 years old -- an eternity in the software world. You should have replaced your shop several times by now. Your car doesn't run forever without oil changes and other maintenance (and it will eventually wear out anyway) -- why should you expect your shop to keep running forever?

Install 2.3.4.1BS Edge/CE/Frozen on a test directory or system, migrate a copy of your data over, and then see what you actually need in the way of add-ons. You may be pleasantly surprised at how much is now built-in to osC. If anything needs to be translated, how much work is that?

Link to comment
Share on other sites

1 hour ago, stratula said:

thank you for quick reply!

But that means that i have to make a complete new shop and there will be almost no addons for latest version even the latest german languages doesn't work with this version.

I think i am in big trouble 

Kinda, you are in trouble in the sense you have not kept up with current technology.... But you are still able to recover.

Most, addons, if they haven't already, have been or can be converted to work with 2.3.4 CE... Although the thought process around these addons has changed - we no longer, when possible, hack up the original code to accomplish the addon. Now, we try to make these addons as a module - leaving the core as untouched as possible.

Download the new version, install it in a subdirectory, play with it.... look around the addon area... ask questions... We all have been where you are now.

If you are not technical enough to do the basic install in a subdirectory, send a commercial request for help.

 

 

Link to comment
Share on other sites

Since the latest version (2.3.4.1BS) has been changing until quite recently, I wouldn't be surprised if some manual fixing will be needed to get the latest German language pack to work on Edge/CE/Frozen. Perhaps you would be kind enough to offer the changes back to the package owner and make them available to the community? Worst case, this will involve manually comparing English and German files side-by-side and updating the German as needed. Since you're presumably fluent in German, you could translate on the spot, rather than leaving new or changed content in English (or using Google Translate to get a rough translation).

Link to comment
Share on other sites

@

On 10/21/2018 at 7:23 AM, stratula said:

hello,

is there a way to get a running system v2.2RC1 working with PHP7 ?

I am upgrading my OLD v2.2RC1 to working with php7 now. Here is what I got so far. (NOTE: My previews application was  running on PHP 5.6. )

Files you need to edit.

store side:

includes/classes/shopping_cart.php

includes/classes/shipping.php

includes/classes/packing.php

includes/functions/database.php

includes/functions/html_output.php

 

admin side:

admin/includes/functions/database.php

 

I change the functions/database.php mysql connection function from 

mysql_fetch_row to mysqli_fetch_array and the application will be able to run under php7. 1.23.

1. replace

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    if (USE_PCONNECT == 'true') {
      $$link = mysql_pconnect($server, $username, $password);
    } else {
      $$link = mysql_connect($server, $username, $password);
    }

    if ($$link) mysql_select_db($database);

    return $$link;
  }

  function tep_db_close($link = 'db_link') {
    global $$link;

    return mysql_close($$link);
  }

with

 function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    if (USE_PCONNECT == 'true') {
      $server = 'p:' . $server;
    }

    $$link = mysqli_connect($server, $username, $password, $database);

    if ( !mysqli_connect_errno() ) {
      mysqli_set_charset($$link, 'utf8');
    }

    @mysqli_query($$link, 'set session sql_mode=""');

    return $$link;
  }

  function tep_db_close($link = 'db_link') {
    global $$link;

    return mysqli_close($$link);
  }

 

2 replace

$result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

to

//$result = mysqli_query($query, $$link) or tep_db_error($query, mysqli_errno(), mysqli_error());
$result = mysqli_query($$link, $query) or tep_db_error($query, mysqli_errno($$link), mysqli_error($$link));

3 replace

function tep_db_fetch_array($db_query) {
   return @mysql_fetch_array($db_query, MYSQL_ASSOC);
  }

  function tep_db_num_rows($db_query) {
    return mysql_num_rows($db_query);
  }

  function tep_db_data_seek($db_query, $row_number) {
    return mysql_data_seek($db_query, $row_number);
  }

  function tep_db_insert_id($link = 'db_link') {
    global $$link;

    return mysql_insert_id($$link);
  }

  function tep_db_free_result($db_query) {
    return mysql_free_result($db_query);
  }

  function tep_db_fetch_fields($db_query) {
    return mysql_fetch_field($db_query);
  }

to

 function tep_db_fetch_array($db_query) {
 //  return @mysql_fetch_array($db_query, MYSQL_ASSOC);
   return @mysqli_fetch_array($db_query, MYSQLI_ASSOC);
  }

  function tep_db_num_rows($db_query) {
//    return mysql_num_rows($db_query);
	return mysqli_num_rows($db_query);
  }

  function tep_db_data_seek($db_query, $row_number) {
 //   return mysql_data_seek($db_query, $row_number);
	return mysqli_data_seek($db_query, $row_number);
  }

  function tep_db_insert_id($link = 'db_link') {
    global $$link;

   // return mysql_insert_id($$link);
	return mysqli_insert_id($$link);
  }

  function tep_db_free_result($db_query) {
 //   return mysql_free_result($db_query);
	 return mysqli_free_result($db_query);
  }

  function tep_db_fetch_fields($db_query) {
  //  return mysql_fetch_field($db_query);
	return mysqli_fetch_field($db_query);
  }

 

You should be able to run the application on PHP 7 with some error. 

Since you can bring up the application, you will be able to patch each addon on your shopping cart to make it works.

I holp this will help

good luck.

ken

 

 

Link to comment
Share on other sites

I am upgrading my OLD v2.2RC1 to working with php7 now. Here is what I got so far.

It's much, much more than just converting from MySQL to MySQLi. So far, you've just scratched the surface of the needed changes. You're in for a lot more work. I really don't think you're going to save anything over installing Frozen and updating it to match the function of your current store, but you're welcome to try...

Link to comment
Share on other sites

I have nearly 80 addons in my CE/frozen shop, all added with little for no core changes.  Simple to change with no messing of the original code due to the addons being of a modular construction.  The language change has to the hardest. 

osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...