Panorama Holzer Kreuz 004Improved compatibility with Joomla 4.2 and PHP 8.1 plus category tree loading speeded up by factor 10

This version took longer than expected, as the team faced several compatibility issues this time. Joomla 4.2 caused more problems than Joomla 4.0 did back then. Suddenly, the 'add to cart' function didn't work anymore, opening shipping/payment methods caused a loop, saving with timestamp failed and so on.

In addition, the changes and removed functions/methods/modes in PHP 8.1 caused further trouble. For example, this caused searches with special characters to not work.
When we were about ready, a customer with more than 8000 categories (in 5 levels) tested the new version with a terrible result. A lot of tweaking was done on the category tree loading process with an improved cache. The idea of the new cache was to store the cached array instead of a rendered result, so the cache is used by almost every function to list categories. It was super fast with the cache created, but building the cache took 29 seconds for 8000 categories.

I took a closer look, and the reason for the error was simple: The cache saved the result every time there was a new result. The solution was to save it only once at the end. That helped a lot, but it still took 8 seconds to build the cache. I told the customer that there was another idea to make it faster, and he agreed to buy a membership to finance testing this idea. The new idea loads the entire table at once and does the tree sorting directly in php. The new result is phenomenal, loading the category tree via ajax now takes only 800ms without cache for the 8000+ categories. With cache it is about 650ms. Of course this is all measured on my computer, and of course the result is a bit different each time. But in more than 10 tests it was between 780-830ms. On the customer's real live server it is even a bit faster.

After the release is before the release. There is still a lot to do for a seamless integration of VirtueMart into Joomla 4, because there is still a lot of change in the Joomla 4 development. From my humble point of view, Joomla 4.0 was not really stable when we look at the problems we got with Joomla 4.2. But the real problem pressure comes from the compatibility issues with PHP8. So our current focus is still on a stable Joomla 3.10.x with PHP 8.

and it happened again, that the release was ready. But the new compatibility fixes needed compatibilty fixes ;-)

New Options:

  • New option BrowseProductCartattributeOnly. This can enhance the speed browsing products
  • Cart; added hidden configs enableCartMerging and enableCartLoad (by stAn)

Improvements FOR users

  • Customfields, translation are shown in the BE
  • Free shipment is calculated without shipment cost
  • Fix for edting order items (by Quorvia)
  • J4 fixed popup of related products/categories
  • added missing empty option to customlist, customlist shows now by default only published customfieldsadded missing empty option to customlist, customlist shows now by default only published customfields
  • customfield dropdown in product edit reacts adding the same customfield the second time

Improvements/Fixes under the hood

  • Added extra checks, so that unbrowseable discontinued products cannot be added to the cart or get removed
  • GetNeighborProducts enhanced it by parsing for more than one orderby correctly. It is better, but still not perfect. Perfect works only with temporarly lists.
  • Removed mf_name from product search
  • Important enhancement for router cache. The cache for the routing is now stored within the maincontroller after everything is executed, to ensure just one call
  • Enhanced cache in category.php
  • Added program cache to getParentsList
  • Fixed wrong limit in getCategoryTree
  • Calls for category tree without media now.
  • Fixed fallback for second language
  • 0.0 prices are no longer inherited
  • Fixes in router for the manufacturer views


  • Added mb_decode_mimeheader to subject of mails
  • added check if function exists for mb_decode_mimeheader
  • Added setConvertInt analogue to setConvertDecimal to define the variables which must be converted to integer (mysql strict mode) and added some of them (for example userinfo)
  • Replaced some overlooked query() against execute()
  • Enhanced deletion of cookie, added check if function exists


  • Use for filtering of strings vmSpecialChars and vmSpecialChars_decode.
  • Use for tables setLockable if applicable
  • Added vRequest::setRouterVars(); to main controllers
  • Enhanced vRequest, can now filter given array
  • Removed default for text to avoid compatibility problems with some dbs
  • Enhanced the currency object, can now be created with custom exchange rate
  • Enhanced vmecho, works now with variables of class vmecho (works standalone)
  • Added lastAddedProduct to the cart object
  • Added hidden configs for CLI; for max_execution_time use givenMaxTime and memory_limit givenMaxRam
  • Added getInt and getFloat to vmConfig
  • updated jQuery.UI min to 1.13.2

DOWNLOAD VirtueMart 4