Jump to content
Lochlann

install 2.3 modules to Phoenix?

Recommended Posts

I'm sorry if this has been asked before, but after searching through 50 pages my ADD took over so here I am asking; sorry.

I have not touched osCommerce since 2.3.0. I do understand that the modules were not written for Phoenix, but in order to have a good shop one needs various shipping modules (ex. FedEx, UPS, Purolator, Canada Post, USPS, DHL, etc) as well as a few other modules (ex. choose quantity on product info page among others). I have not yet been able to find any for Phoenix. Is it possible to install some of the older ones into Phoenix? I don't mind tinkering with the code, but I want to check the possibilities before starting to tinker. Some of the screenshots I have seen for modules I have installed you can clearly see activated modules that I cannot seem to find for Phoenix anywhere.

Thanks so much in advance.

 

Phoenix v1.0.3.0 (Semi Fresh Install)

Share this post


Link to post
Share on other sites

Most modules will need the following updates:

  • replace the class constructor name (first function in the module) to "__construct" for PHP 7 compatibility
  • replace the path constants like "DIR_WS_INCLUDES" to hardcoded paths like "'includes/'
    FOr to know which have been removed compare the "includes/configure.php" files from your old store to the Phoenix files. The definitions which are not in Phoenix any more need to be replaced
  • replace all database table names like "TABLE_CONFIGURATION" with hardcoded real names "'configuration'"
  • if the module produces any html output, it might need to be updated to bootstrap 4.
  • if the module uses any jquery script, it must be injected now in the footer script area. compare to some ht modules how it is done there

Best is to have al look in the supplied core modules and compare

Edited by raiwa

Share this post


Link to post
Share on other sites
3 hours ago, raiwa said:

Most modules will need the following updates:

  • replace the path constants like "DIR_WS_INCLUDES" to hardcoded paths like "'includes/'
    FOr to know which have been removed compare the "includes/configure.php" files from your old store to the Phoenix files. The definitions which are not in Phoenix any more need to be replaced

All others listed I understood. I understand about hardcoding paths, but there is no old store to compare too. This is a semi fresh install of Phoenix (couple Phoenix modules added)

It's just that Phoenix (In my opinion) is really lacking when it comes to modules (I'm sure this will change in due time though). For example; I can't find any shipping/tracking modules and they are definitely needed.

Share this post


Link to post
Share on other sites

Here the old version of the includes/configure.php. Compare to yours and you'll see the constants which have been removed:

configure.php

 

Meanwhile, the first thing you could do when you have a shipping module updated, upload it to the Marketplace to share it with others.

Edited by raiwa

Share this post


Link to post
Share on other sites

@Lochlann

2.3 BS "shipping" modules, as "order_total" modules, must work on Phoenix, the only difference must reside in the upgrade of icons (if there is any), BS4 "grids" stucture, filenames and path constants like @raiwa said.
Try to install a module and if there is a problem it will be necessary to rectify the points previously discussed.

Edited by milerwan

Osc v2.3.4 BS "custom"
PHP 7.3 compatible (710 modified files => o_O')

Share this post


Link to post
Share on other sites
2 hours ago, Lochlann said:

I understand about hardcoding paths, but there is no old store to compare too.

The change was here.

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

Which if we hardcode paths in it would become

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', 'images/icons/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', 'includes/functions/');
  define('DIR_WS_CLASSES', 'includes/classes/');
  define('DIR_WS_MODULES', 'includes/modules/');
  define('DIR_WS_LANGUAGES', 'includes/languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

Replace occurrences of the values on the left (without quotes) with the values on the right (with quotes retained).  If you have two hardcoded strings together, e.g.

'images/' . 'icons/'

You can merge them like

'images/icons/'

That makes no functional difference, but it may make them easier to read. 


Always back up before making changes.

Share this post


Link to post
Share on other sites

Well, after looking at one of the modules for porting (It was a bit of a mess) Simply changing the class constructor won't suffice. It will take someone like me a VERY long time to do (I'm not well versed in php). The biggest problem I am finding is that the module needs to first be converted from an old version of php to php7. This is where I am going to have some major issues. Also have to look at how to change it so it doesn't interfere with the core code since this one requires core code change. Wish there was some kind of open source Linux program that would update the code for me.

Share this post


Link to post
Share on other sites
34 minutes ago, Lochlann said:

Well, after looking at one of the modules for porting (It was a bit of a mess) Simply changing the class constructor won't suffice. It will take someone like me a VERY long time to do (I'm not well versed in php). The biggest problem I am finding is that the module needs to first be converted from an old version of php to php7. This is where I am going to have some major issues. Also have to look at how to change it so it doesn't interfere with the core code since this one requires core code change. Wish there was some kind of open source Linux program that would update the code for me.

You could always make a request, in our commercial forum, for a quote to have it updated for you.  

Dan

Share this post


Link to post
Share on other sites
19 hours ago, Dan Cole said:

You could always make a request, in our commercial forum, for a quote to have it updated for you.  

Dan

Unfortunately that is not something I have the ability to do right now. To be straight.... I'm a disabled person looking to change my life around and this shop I am building will do it. Funds are extremely limited at this point. If this was 6 months from now that would be a different story all together and it wouldn't be an issue, but for now I have to build up to that.

Share this post


Link to post
Share on other sites
4 hours ago, Lochlann said:

Unfortunately that is not something I have the ability to do right now. To be straight.... I'm a disabled person looking to change my life around and this shop I am building will do it. Funds are extremely limited at this point. If this was 6 months from now that would be a different story all together and it wouldn't be an issue, but for now I have to build up to that.

I get that.  I guess you'll need to DIY.  I would just jump right in, load up the module see what errors it produces and then post both the error message and the code here and perhaps someone will be able to point you in the right direction.  Most of us tend to learn that way and just keep plugging away at it.  You'll probably find that others have had the same issue so googling the error message might also get you the help you need without even having to post for help.

Dan

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

×