Skip to content

OrderFlow Magento Integration Guide

OrderFlow Ltd.

Document Version: 4.2.4

Document Built: 2024-02-16

This document and its content is copyright of OrderFlow Ltd. All rights reserved.
You may not, except with our express written permission, distribute, publish or commercially exploit the content.
Any reproduction of part or all of the contents in any form is prohibited.

Installation

Installation

This section documents the install process. As described in the Support Arrangements chapter, the process of installing the OrderFlow Magento extension needs to be undertaken by the Primary Support Agency, supported by OrderFlow and, where necessary, the Extension Developer.

The installation is performed as a file-based install via a supplied compressed archive in the tar.gz format.

An install based on the Composer PHP dependency manager is also possible for Magento integrators who are already familiar with and would like to continue using this tool. However, this option is not covered in this document.

Prerequisites

For the Magento extension to run, developer symlinks need to be enabled.

From System -> Configuration -> Developer -> Template Settings, select 'Yes' to the Allow Symlinks option.

Obtaining the Files

During the Induction Process, the Primary Magento Agency will be directed to the relevant release.

The latest built release is available via the following URL:

https://www.sixbysix.co.uk/orderflow/releases/.

In most cases, you will need to download the most recently available file from the list.

The selected file can be downloaded and placed in the Magento root directory using the command:

sudo -u www-data wget https://www.sixbysix.co.uk/orderflow/releases/orderflow[version].tar.gz -O orderflow.tar.gz

Example output is shown below:

sudo -u www-data wget https://www.sixbysix.co.uk/orderflow/orderflow.tar.gz -O orderflow.tar.gz
--2015-09-10 14:57:51--  https://www.sixbysix.co.uk/orderflow/orderflow.tar.gz
Resolving www.sixbysix.co.uk (www.sixbysix.co.uk)... 178.79.180.182
Connecting to www.sixbysix.co.uk (www.sixbysix.co.uk)|178.79.180.182|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.sixbysix.co.uk/orderflow/orderflow.tar.gz/ [following]
--2015-09-10 14:57:51--  https://www.sixbysix.co.uk/orderflow/orderflow.tar.gz/
Reusing existing connection to www.sixbysix.co.uk:443.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.sixbysix.co.uk/orderflow/releases/orderflow-1.0.0.30-master.tar.gz [following]
--2015-09-10 14:57:51--  https://www.sixbysix.co.uk/orderflow/releases/orderflow-1.0.0.30-master.tar.gz
Reusing existing connection to www.sixbysix.co.uk:443.
HTTP request sent, awaiting response... 200 OK
Length: 418600 (409K) [application/octet-stream]
Saving to: orderflow.tar.gz

100%[================================== .... =====>] 418,600     1.94MB/s   in 0.2s   

2015-09-10 14:57:51 (1.94 MB/s) - orderflow.tar.gz saved [418600/418600]

Note that through the -u www-data the file is being downloaded with the www-data user permissions.

Deploy the Files

Warning

We'd strongly recommend taking a backup of the Magento web root directory before performing this operation, in case any mistakes are made and need to be reversed.

Once the files have been extracted they can be installed in the Magento web root directory.

The file can be extracted into the Magento web root directory using the following command:

sudo -u www-data tar -xvf orderflow.tar.gz

Note that this command does not extract the module files directly into the application subdirectories. Instead, it extracts the files into a subdirectory which corresponds with the version of the file that has been downloaded. After the extraction, a versioned file will be present in the Magento web root directory:

/var/www/magento$ ls -l orderflow-1.0.0.30-master/
total 12
drwxr-xr-x  5 www-data www-data 4096 Sep 10 13:42 app
drwxr-xr-x  3 www-data www-data 4096 Sep 10 13:42 skin
drwxr-xr-x 11 www-data www-data 4096 Sep 10 15:38 vendor

The files in these subdirectories can then be copied into the root subdirectory in the following way:

cd orderflow-1.0.0.30-master
sudo -u www-data cp -R * ../

Updating the Extension

Warning

We'd strongly recommend taking a backup of the Magento web root directory before performing this operation, in case any mistakes are made and need to be reversed.

Performing the module update can be done in exactly the same way as performing a module install. Simply follow the steps in the previous section, overwriting the existing module files as necessary.

In case the state of any existing install is uncertain, it is best to clean down the environment to uninstall the existing extension ready for a new installation. To uninstall the module navigate to the magento root directory, and run the following command:

$ sudo rm -rf app/code/community/SixBySix \
vendor/sixbysix
app/design/adminhtml/default/default/layout/realtimedespatch.xml \
app/design/adminhtml/default/default/template/realtimedespatch \
app/etc/modules/SixBySix_RealTimeDespatch.xml

Cron Setup

The OrderFlow Magento extension relies on the use of the Magento scheduling functionality to run background jobs. The Magento cron functionality will need to be enabled.

A commonly used extension for managing scheduling in Magento is AOE Scheduler. If scheduling has been set up using this extension, then no further setup will be necessary.

If not, the the Magento cron functionality will need to be turned on. To do this, run the following command:

sudo crontab -u www-data -e

Using one of the editors, add the following line to the crontab file, and save.

*/1 * * * * /bin/bash /var/www/magento/cron.sh

The above result in the Magento scheduling functionality being invoked every minute.

Final Steps

A couple of further actions will need to be performed before the module extension install or update properly takes effect.

First, clear the Magento cache. This can be done from the Admin Panel, by navigating to System -> Cache Management and clicking 'Flush Magento Cache' and 'Flush Cache Storage'.

It may also be necessary to clear the Zend framework cache, which can be done on the command line via

sudo rm -rf /tmp/zend_cache---*

Second, log out and log in again.

Verification

After the install has been completed, a few basic verification steps can be conducted to ensure that the module has been installed properly.

  • The OrderFlow menu item should appear at the top level menu on the Magento Admin Panel.

magento verification top menu

  • An OrderFlow menu should also appear under System -> Configuration in the SERVICES section.

magento verification orderflow menu

At this point you can verify that navigating to these menus shows module-specific screens, without any errors being reported.

System -> Configuration -> Services -> OrderFlow should display the module version number and text similar to the following:

OrderFlow v1.0.0.30 A module provided for OrderFlow by the Magento agency SixBySix

(Note the version number for support and/or future upgrades.)

If some or all of these elements are missing then the installation has failed. At this point, view the Troubleshooting section below, or attempt to reinstall the module. If necessary, raise a support request with the OrderFlow support team for further assistance.

The following chapters will cover further verification of the functionality of the extension.

Troubleshooting

Below are the suggested remedial actions following problems encountered during previous installation on certain environments.

Permissions Not Correct

In a typical Debian or Ubuntu distribution of Linux, the Magento application is served from an Apache Virtual Host mapped from a subdirectory of /var/www, for example, /var/www/magento but the document root directory from which Magento is served will be dependent on your server environment.

The Magento application needs to read, write and execute access to this folder via the Apache user, normally www-data in a Debian or Ubuntu distribution.

If correcting permissions is necessary, you can use the following command from the Magento root directory:

sudo chown www-data:www-data -R ./

OrderFlow menu is not visible

If following installation the OrderFlow menu is not visible on the Magento Admin Panel, the files may not have installed correctly. From the Magento root directory, run the following commands:

ls -l app/code/community/SixBySix 
ls -l vendor/sixbysix
ls -l app/design/adminhtml/default/default/layout/realtimedespatch.xml
ls -l app/design/adminhtml/default/default/template/realtimedespatch
ls -l app/etc/modules/SixBySix_RealTimeDespatch.xml

None of the file commands above should return an empty listing. If so, then repeat the steps described in the Deploy the Files section.

404 on Configuration Screen

If you see the '404 Not Found' when navigating to System -> Configuration -> OrderFlow, you will need to log out of the Magento Admin Panel, and log in again.

Blank Screen When Exporting Product to OrderFlow

Magento error messages are hidden by default, so the you will need to enable display of errors. In Magento 1.9.1.1 this can be done by adding the following lines to the index.php file in the Magento root directory:

Mage::setIsDeveloperMode(true);
ini_set(display_errors, 1);

The lines will need to be added before the Magento is framework is invoked, that is prior to the line:

Mage::run($mageRunCode, $mageRunType);

Subsequent attempts to perform the same operation will then show a stack trace. If a stack trace similar to the following is shown:

Fatal error: Class 'SixBySix\RealtimeDespatch\Api\Credentials' not found

then a cacheing issue has occurred. In this case, clear the Magento and Zend framework caches. If this does not resolve the issue, then PHP Opcacheing may be enabled, in which case a restart of Apache will be necessary to fix the problem.