Basic OpenCart Guide for Non Developers - xerocrypt/opencart GitHub Wiki

OpenCart is essentially an e-commerce platform that's typically installed on a LAMP stack - that is, it's developed in the PHP language, and works in conjunction with the Apache server and MySQL. Anyone should be able to install OpenCart on a typical standard Web hosting plan, and use it as a platform for an online store. The dashboard is very easy to navigate, and managing an online store should be straightforward.

In my experience, however, actually getting an OpenCart store running required some expertise and eperience with the MVC Web application development, plus some time spent studying the files that make up the platform.

This page is intended to be a guide for those without the expertise.

Disadvantages

  • You definitely need the support of developers versed in PHP and LAMP.
  • The platform must be installed on a Web server, under your own hosting plan. This means backups, business continuity and disaster recovery and security are the business' responsibility.
  • You will need to develop or install modules in order to make any significant changes to an OpenCart site or add extra features.
  • A good understanding of the MVC pattern is required.

Here is a case study in what could go wrong:

  • A dodgy module was installed from a non-oficial source.
  • The dodgy module screwed up several core files. To this day I still don't fully know what was overwritten.
  • One thing I needed to do was repair a broken reference to a system file in the vqmod cache.
  • Next I needed to repair the model.
  • Thirdly, I needed to copy a specific file from a backup to the current installation.

Moral of the story is that mistakes will happen, and you'll need access to the expertise to fix things.

Backup and Disaster Recovery

Personally I make a backup of the home directory in the cPanel, the option for which is found under Partial Backups.

Also, you'll want to make backups through the dashboard, under the System - Maintenance - Backup / Restore tab. Here I'll backup everything listed - these are the database tables for the OpenCart store.

Troubleshooting

  1. See the error log in /home/[user]/logs. This will indicate the cause of the error.
  2. Sometimes the log entries indicate a PHP error. Fixing this shouldn't require more than a very minor change to the file and line of code indicated in the relevant log entry.
  3. Another useful diagnostic resource is the Developer feature in the Web browser. This will reveal the server response codes and which files might have failed to load.

Status codes are: 200 - Content served successfully. 3xx - Usually a routing/redirect problem. 4xx - Missing file(s), or files could not be found, or incorrect file paths. 5xx - Typically indicates a server configuration issue.

Interface Changes

The first concept to grasp is that of .twig files and modules, as, together, they determine what appears in the user interface. The .twig files determine the general layout of the page.

Any additional JavaScript functions and AJAX calls should be placed in the common.js file.

The theme cache must be reloaded. In the Dashboard tab, click the blue cog button at the top-right. In the Developer Settings modal, click the Refresh button for the theme.