Session handling in OXID eShop 6

With OXID eShop 6, there will be some changes in the session storage system. Until now there was the regular PHP session handling using the file system. Optionally, with the config option blAdodbSessionHandler, a feature of ADOdb lite was used to store sessions directly to the OXID database.

As we replaced ADOdb lite with the more modern Doctrine DBAL database layer, this feature will not be available any longer. There are clever alternatives that will make your OXID eShop project even more scalable, better performing and getting better fail-over capabilities.

When working on regular web space, a vServer or even a root server, nothing will change for you. This blog post is interesting for you if you’re running multiple application servers or hosting in the scalable cloud.

Sticky Sessions

By default, PHP handles sessions on basis of the file system. This works perfectly as long as you run a small or medium sized online business with one server or a hosting package. Although this solution is very easy to implement, there are some disadvantages when it comes to multiple application servers with an upstream load balancer:

A load balancer assigns the first client request to a physical application server (see figure below), and all following requests of this client to the same physical server. In order to remember the client, the load balancer tries to identify it via:

  • it’s IP address
  • TCP payload offset and length
  • HTTP query string elements
  • header field values
  • cookies
  • etc.


As mentioned above, using sticky sessions, sessions are saved locally in the file system of the application server. This may provoke problems if a client with an active session is assigned to another application server because his session data is suddenly lost. This may occur for example if

  • the application server has to much load and the load balancer can’t assign more clients to this application server
  • during the maintenance time of an application server
  • a user is not identified correctly because it’s IP changes, NAT networking, etc.

Non-sticky sessions

In order to resolve these issues, there’s another concept known as “non sticky sessions”. In this scenario, the load balancer may assign any of the physical application servers to serve a request. The session data is saved centrally:


Until now we supported the non-sticky session concept by writing the sessions into the OXID database via ADOdb lite using the OXID eShop option blAdodbSessionHandler. Unfortunately, using the application server database as session storage, has some disadvantages as well:

  • the more application servers used, the less scalable it is to use the application server database.
  • the application database server gets even more load by the sessions. Sessions ususally have a read/write ration of 1/1.
  • the application database can become very large.

Use your own session storage

ADOdb lite was replaced with Doctrine from OXID eShop 6 on, so the feature of writing sessions by simply switching on an option is not available any longer.

Also, there are manifold other solutions out there for session handling like Memcached Session Manager or Redis. The setup is simple as there are already PHP plugins available (php5-redis) – you just have to tell your PHP installation to use Redis as a session handler. Please read this blop post for more information:

If you want to store your sessions into a database anyway, you have the possibility to write your own session handler. Here are some hints on how to do that. First, you have to implement a class which has access to your session storage and implements some standard methods like read and write (like the old adodb class core/adodblite/session/adodb-session.php).

In order to make this class work with OXID eShop, you have to extend the OXID eShop Session class with a module.

If you have questions, please don’t hesitate to comment this blog post.

Language handling

Translation and language maintenance software

For translations and maintenance of language keys, we decided to use oTrance, the Online Translation Center (available under GPLv2) and installed it on

Download language packs

You cannot help with language translations? No problem. Simply go to to get logged in as a guest.

If you need help with the translation software, please refer to this wiki page where the handling with a guest account is explained:

There’s also a forum available for your questions at

If you are familiar with using GitHub, you can also check out for available languages. will export to this repository regularly.

Additionally, we offer downloads of single language packs (per language) marked as “OK” or “perfect” from the download area of this site.

Help translating

If you want to help translating and/or maintaining the languages, please register at After that, please wait for the system administrator to activate your account before you can start translating.

If you want, you can also maintain your translations with this tool. The advantage is that there will be no hassle with character encoding or possible mistakes – for example, if you forgot a comma or a quote.

If you have already files translated into your language, please send them to We will import them into the system and make them available to the community.

If you need help with the software, please refer to this wiki page where is explained how to use oTranCe as a translator:

There’s also a forum available for your questions at

For OXID specific translation questions and announcements please refer to

But first, you might want to watch this screen cast about working with oTranCe as a translator:

Installation of new languages in OXID eShop

  1. Download the language packages from oTranCe.
  2. Extract them and upload them to the according paths of your shop installation.
  3. Go to the admin panel of your OXID eShop installation -> Master settings -> Languages. Add a new language and enter the abbreviation according to the one you found in oTranCe.
  4. In admin panel, go to Service -> Tools and push the “Update views” button.
  5. Clear the tmp/ folder in your installation and refresh your page.
  6. You are done 🙂

Language maintenance for German and English

OXID will take over the language maintenance for German and English as it will be delivered with each standard copy of OXID eShop in any edition. Any other translations can be contributed, maintained and downloaded by community members for free use under GPLv3 license. With every stable release of OXID eShop, OXID will update the oTranCe database with both languages. You don’t have to register at for helping with German or English 🙂 If you found something strange like a misspelled word or another typo in one of both languages, please simply open up a bug for it at or send a pull request via GitHub.

Integration with GitHub

oTranCe is able to export the ready-to-use language files to any SVN as well as to GitHub:

Here, we added map.php files, flags as well as transliteration lists. These files are also provided when downloading the package from

File structure

Digging deeper – which files to touch for translations

On we already use file templates for export so the right format. The exact number of files and the right folder structure will be available in the download packages.

The following points are just for your information.

Translating the store front, using the standard template “Azure”

If you want to translate the store front using “Azure” or a derived work from it, you have to translate the following files:

  • /application/translations/{LOCALE}/lang.php
  • /application/view/azure/{LOCALE}/lang.php

Translating the administration area

If you want to translate the administration area you have to translate the following files:

  • /application/views/admin/{LOCALE}/lang.php
  • /application/views/admin/{LOCALE}/help_lang.php
  • /application/views/azure/{LOCALE}/theme_options.php

Translating the setup

If you want to translate the setup routine you have to translate the following files:

  • /setup/{LOCALE}/lang.php

Other language related files

There’s a number of files related to languages but not to translations. These files are already implemented in the download packages on


Of course, a language needs a flag, doesn’t it 🙂 That’s why we put a flag into the language pack the first time we get in touch with that language. This can be when a translation is started, when we get language files or even when somebody registers for this translation at

The size of the flag is theme dependent, that’s why it was put to the folder /out/{theme}/img/lang/. So an image file with a language flag for the theme “azure” can be found at /out/azure/img/lang/{locale}.png and is adjusted to 14 x 10 px.

If you want to translate into a new language not listed yet we’d appreciate if you could provide the flag either by a pull request on GitHub or by sending it to

Transliteration lists

Why is a transliteration needed and what it is used for?
Well, in some languages you don’t just use pure Latin characters but also so called “Umlauts” for pronouncation purposes. In case these “Umlauts” appear in the title of a product, the class oxseourl tries to form a proper URL from it.

Just an example: If you sell belts, the German translation for it would be “Gürtel”, using the Umlaut “ü” in the product title. If you didn’t enter any transliteration, oxseourl would swallow the “Umlaut” and the URL would go like But who the heck of your potential customers is googling for “grtel”? So the correct URL should be as the search engines would understand “ue” for “ü”. For this reason, there has to be a transliteration array telling OXID eShop how to transliterate special characters like “ü” shall become an “ue” in the URL which is applicable.

Talking about non-Latin-based languages, it becomes even more complex. Let’s talk about Russian using the Cyrillic script. Here, the transliteration list is pretty much longer, containing “я”, “ю” and “ж” which can be transformed to “ya”, “yu” and “zh” in the URL.

In this manner, Cyrillic is still pretty simple as it uses just different characters. Another challenge are Asian languages as their scripts describe syllables as well as entire words. We are not really sure if pinyin for Chinese, for example, can resolve this 😉

Until OXID eShop v4.5, transliteration lists have been stored in the OXID eShop database. Maintenance was held inside the admin panel: Master settings -> Core settings -> SEO -> Characters which are replaced in SEO URLs.

In OXID eShop version 4.6, we stored transliteration lists inside the language files where needed. In version 4.7/5.0, the transliteration lists disappeared from the admin panel and will be stored separately from the general language files but at the same level as translit_lang.php, for example:

We’d be glad if you could share your transliteration lists with the community. Simply send a pull request via GitHub or drop an email to if you’re not familiar with version control systems.

Language key mapping – what is map.php

With the introduction of theme handling in OXID eShop 4.5.0, there were different language strings for each theme. We were using two different theme-dependent language files for the basic and azure themes. To make this system more flexible and to avoid redundancy and repetition in language constants, we moved to a generic language file which is valid for all themes (even self-made themes) in version 4.5.1.

By this, it is possible to use different language strings per theme. Of course, the override functionality is still available for all of these files, so your system will remain easily updatable as long as you make use of the cust_lang.php file.

We implemented a mapping file to enable mapping between the generic language constants and the theme-specific constants. This is to ensure maximum flexibility when updating the system. In most cases, the language constants from the azure theme will be simplified and used as the basis for generic constant names.

Example: You will notice that there are many different definitions for email in both, your custom and azure theme, like the examples below:

The new generic language file has only one constant for email:

The mapping array will take care of defining the basic and azure theme constants’ relationships with the generic language file:

If a theme needs to change specific constants, it can do this by redefining the constants inside the theme-specific language file:

Language override system – cust_lang.php

For your own customizations, you can use custom language files per theme (remember that these will be excluded from update packages as well as from language packs). And if you’re a user of OXID eShop Enterprise Edition, there is also another override level for your subshops.

To summarize, the priority for language handling will be like this:

custom language file -> theme language file -> subshop language file -> general language file

Build an Infinite Scroll List for OXID eShop – Implementation

In the previous part we have examined the step-by-step process of back-end implementation for the module serving the infinite scrolling list. We also added some code for the controller but it didn’t bring any clear-cut result at that moment.

This second part will help you finish the remaining tasks to achieve an infinite scrolling list. Let’s see how to work with the new template and JavaScript code to handle the logic of infinite scrolling. I will then show you the proper way of activating a new module, and will include some hints that will keep you away from unexpected issues.

Customizing the OXID locator bar

It feels pretty good to find out you only have to replace some blocks of the current template. Sometimes, you don’t get that lucky, and you need to have a whole template file replaced.

Please open the template /application/views/azure/tpl/page/list/list.tpl, copy its content and paste it into the new file /modules/aho_infinitescroll/views/page/list/aho_infinitescroll_list.tpl.

Open the file aho_infinitescroll_list.tpl, and search for the line containing the following code:

  • locator=$oView->getPageNavigationLimitedTop() will display the traditional pagination that will no longer be necessary.
  • listDisplayType=true lists out all available view options. We don’t need this either. The new module will use the view type defined in the module’s settings.
  • itemsPerPage=true determines whether the user can select how many articles to display per page. In this tutorial, we also turn off this feature.
  • sort=true controls the sorting conditions. We’ll leave this on.

Let’s examine the below figure to study the locator’s elements with their corresponding position:

"locator noted"

Please replace the above line with the below line to drop unnecessary elements:

We also look for and remove the following line to turn off the bottom locator:

Here is the result:

"final Locator bar"

Implementing Infinite Scrolling Load

1- Preparing the stylesheet

Open the file /modules/aho_infinitescroll/out/css/infiniteloading.css and paste the following code:

2- HTML elements
Reopen aho_infinitescroll_list.tpl. After the line of including the template locator.tpl, we put the following lines:

  • The first line defines a variable to get the proper module’s URL. If you have several JavaScript or CSS files to include, this will be really useful. Please note that you should never add any raw URL for such files, they may fail to load due to different OXID versions.
  • The second line will include a stylesheet for this module.
  • The third line adds a div that will temporarily hold next-page loaded articles.
  • The next block will create a wrapper with two subsequent elements: loader icon and button to trigger an Ajax request.

The result after applying CSS will be:

"List with CSS"

3- Adding JavaScript code

Put the below JavaScript code into the opening aho_infinitescroll_list.tpl, just after div.loader-container

  • The first line defines an important template variable. It will fetch essential values such as total pages, current page, next page, first page, last page and URLs for each page returned. You can use [{$pages|var_dump}] to examine all values of $pages.
  • The remaining code implements the logic of infinite loading with the below workflow.
    • We will have an extra button to trigger the request to load articles of the next page.
    • A hidden loading image toggles to prevent re-clicking.
    • New articles will be appended to the end of the list.
    • Every click of the button will repeat that process until there are no more articles to be loaded. At that moment, the button is disabled.

4- Front-end translation

Please go to /modules/aho_infinitescroll/translations/.
For bothen/aho_infinitescroll_lang.php and de/aho_infinitescroll_lang.php, we add the following:

Please assign the correct value of variable $sLangName for each file. The name of the front-end language file always follows this formula:

module folder name+ _ + lang.php

Activating the module

Activating the module usually seems totally effortless with a couple of clicks in the back-end. Sometimes, however, the module might not work for an unknown reason. If you encounter such a problem, please check the following steps:

  • If you make any changes in metadata.php, you have to disable the module, then re-enable it.
  • If you have made any changes relating to the database, you have to update the database view. You can do it via Service > Tools > Update DB Views now.
  • You have to clear the tmp folder after any changes.
  • You should always set proper permission mode for /log/EXCEPTION_LOG.txt to inspect the logs.

To help your testing to go well, you can go to the back-end and decrease the number of items per page.
Go to Extensions > Themes > {Pick active theme} > Settings > Display, change the value as in the follwing figure:

"config change"

The above adjustment is just for OXID’s default data, which has few articles . If you already have a long-list of articles of your own data installed, that change is unnecessary.

Further Enhancements

There will be a variety of approaches to implement infinite scrolling for OXID eShop. We’ve attempted to bring you an essential implementation from back-end to front-end. There will be a lot of improvements that you can do for this module:

  • Using a third party jQuery plugin to achieve infinite scrolling effect instead of using manual trigger. You can grab a good plugin from by Paul Irish.
  • We have set the view option to line as default value. You can customize this to make it work for all view options.
  • Applying the SEO-friendly approach for your module. This article seems very helpful for reference.
  • Extending the functionality to the search page.


You can watch the final result on YouTube and download the code from GitHub.

Despite the old-fashioned appearance of the back-end, OXID eShop is flexible enough to achieve as much functionality as other e-commerce systems. I hope this tutorial taught you something new, and that you may find out that OXID is a worthy option to consider for your next e-shop.

Please feel free to share your perspectives with me in the comments below!

How to move a database bigger 2MB

How to move a database > 2MB


Most hosting provider set the limit to the PHP upload function to 2MB which makes it not easy importing databases > 2MB to your new installation if you use e.g. phpMyAdmin as your database management tool. For this cases, you might want to install another application that works differently like MySQL Dumper or use just the most easy way if you have SSH access to your server.

  • Upload the sql file to your server.
  • Move to the folder the sql file is situated.
  • Use the following command to insert the sql file to your database

    Of course, you have to replace the values for [database_user] – your specific database user [database_password] – your spacific database password [Port] – the portnumber of your database in case it is different then 3306 [your_file] – your source database dump
  • Take care: No progress bar is shown while uploading the dump. For huge databases, just wait for the next prompt.


For dumping your existing database > 2MB to a sql file, type the following:

[Update 30th June 2016]

In case Profihost is your hosting provider, please use the following command for a database dump: