extension duplicated after upgrade to 2.3.02

check old and new admin and catalog folder , check extra folder left from old version rename it


PHP error after updating from 2.2.0.0 to 2.3.02


the official Opencart v2.3.0.2 bug reports topic to report any issues from the core.


BUG: Error: Could not load model total!

Two-part bug. Part one: Event Compatibility cuts off too many parts of the route when trying to load the older extension format. ex. "extension/total/sub_total/getTotal" route gets turned into "total/sub_total" instead of "total/sub_total/getTotal". This causes it to try and load a model with no name throwing the exception. Part Two, this compatibility is being loaded fine when the route is "extension/total/subtotal" but is also loading when the route is "extension/total/sub_total/getTotal". I think this event should not be triggered for compatibility because it is a getTotal is a function call, not a model load. This causes the verification to fail and try to load the 2.2.x version which has other bits missing and throws different errors. Haven't figured out why the function call is going down the event path. But basically the attempt to support backwards compatibility with 2.2 mods is causing problems.

2 Solutions

FIX 1: Give up on 2.2.x compatibility and delete the following left-over folders: 
Code: Select all
    catalog/model/total
    catalog/model/payment
    catalog/controller/payment
    catalog/model/shipping
    catalog/controller/module
    admin/controller/total
    admin/controller/payment
    admin/controller/shipping
    admin/controller/module


FIX 2: Add a hack to bypass the event when the function call for "getTotal", "getMethod", or "getQuote" are passed in. This is experimental but should at least restore support for 2.2.x mods for now. This is NOT a permanent fix. Just a work around.
EDIT: catalog/controller/event/compatibility.php
FIND: 
Code: Select all
'model/' . $route. '.php'

REPLACE WITH:
Code: Select all
'model/' . ((strpos($route,'get') !== false) ? dirname($route) : $route) . '.php'

This should let routes like "extension/total/sub_total" work but block "extension/total/sub_total/getTotal" calls which fail on the directory check.



BUG: When enabled, fraud modules cause an error to be thrown during order completion, which can prevent the order from being fully completed. The error message thrown is: "Call to a member function check() on a non-object in /catalog/model/checkout/order.php"

How to Upgrade OpenCart Step by Step?

Step 1. Backup OpenCart

Basically you can download a copy of your OpenCart files from web server to your computer through FTP or your hosting control panel. Then export its database through phpMyAdmin or go to back up the database from OpenCart dashboard >> Tools >> Backup/Restore.

Step 2. Download latest version of OpenCart

Step 3. Upload new OpenCart version to server

When you have unzipped OpenCart installer on your computer, you should find a ‘upload’ folder. You need to upload all its files and subfolder from computer to your web hosting, except “upload/config.php” and “upload/admin/config.php“. In OpenCart 2.0.2.0, these two files seems can not be found. It does not matter which OpenCart version you are upgrading to, always double check to ensure these two files not to be uploaded

Step 4. Install OpenCart from web browser

Every new OpenCart installation will have an ‘install’ sub-folder in the OpenCart root directory. Now you need to launch the auto-installer from your web browser. Open a web browser on your PC or Mac, enter your OpenCart domain name in the address bar, add /install/ after your OpenCart site URL address, then press Enter key on your computer to initiate the OpenCart auto-installer. Since this is an OpenCart upgrade other than fresh install, only few steps required from now to complete the upgrade to new OpenCart version. 

Now you have finished upgrading OpenCart to the latest version! Oh, one last thing, don’t forget to delete your installation directory for website safety reason.