plugins
So I have plugins working, right? So what?
Well, as it turned out things were not as simple as I expected (are they ever?). In this case, the fact that a lot of zen-cart logic is file based really slowed me down. (more…)

So I have plugins working, right? So what?
Well, as it turned out things were not as simple as I expected (are they ever?). In this case, the fact that a lot of zen-cart logic is file based really slowed me down. (more…)
Work on the new release is progressing quite well. Still, as with the previous releases, it will include stuff I didn’t plan and didn’t even knew would ever be part of ZenMagick in the first place! (more…)
A thing I noticed that seems to cause some trouble are the .htaccess files I recently added to ZenMagick.
Intention is to protect direct access to ZenMagick code, while allowing the webserver to serve the theme files as required.
While this works on my test system and a few other sites, it seems to be broken for some. The effect is that CSS, JavaScript and images are not displayed at all. So all you will see is the unstyled page.
Deleting the .htaccess files in both zenmagick and zenmagick/themes should do the trick for now …
Apologies to everyone waiting for a toolbarmode update for TB2. It’s in the making, but due to additional requirements I decided to rewrite my whole build process. (more…)
I thought I wou;d share a few more small fact about ZenMagick with the rest of the world. Who knows, it might be useful…
Using ZenMagicks zm_href(..) function will generate always links using product_info as main page
This saves one database lookup per link per page and makes all product links look the same. The product info
controller will resolve this to the actual page type (product_music_info, etc) when the page is requested.
Another benefit is that the URL still works even if the page type for the product is changed (useful, for example, for booksmarks)
Theme inheritance is handy but, of course, uses additional resources. If you know that you need a lot of custom theme code, it is perhaps worth copying the default theme folder (don’t forget to change the theme info class) and disabling inheritance. There is a ZenMagick setting for that, so in local.php it should look like this:
zm_set_setting('isEnableThemeDefaults', false);
This should save a few milliseconds during theme initialisation.
More next time….
It just occured to me (actually it’s been sitting at the back of my mind for a while) that the page execution numbers that you can see in the footer of the ZenMagick website and the online demo store have only limited value.
Since the site is configured to cache pages, the numbers will be the same for as long as the cache is valid. If in doubt, check the page source for something like this (at the bottom):
<!-- stats: 0.0294 sec. for 6 queries; page: 0.3701 sec. -->
Those are the *real* stats forĀ pages returned by the ZenMagick page cache. Looks a lot nicer to me ![]()
The event handling in zen-cart is soemthing I have never spent a lot of time thinking about. I had to, though, when implementing the email handling. It was the only way to hook into some of the zen-cart code the way I needed.
The ZMZcoObserver class makes attaching custom code quite easy while keeping things pretty local. Especially, adding callbacks to functional code is easy done in three simple steps (it’s still easier for subsequent events):
$zco_notifier->attach($this, array('NOTIFY_HEADER_START_GV_SEND'));onHeaderStartGvSendWhile being convenient, I do not like the event architecture very much. So it is no wonder that there isn’t something equivalent in ZenMagick. It’s not needed, though, as themes can easily extend existing controller and thus do whatever they like before or after request handling. They might even reimplement request handling altogether.
If needed, the base ZMController class could be extended to call some new methods at the various stages of the request handling. Unitil then, no events in ZenMagick.
Looking back at my latest roadmap update, I am actually surprised how many items on that list are already ticked off!
Admittedly, there are some outstanding issues I am not really looking forward to tackling. This could be either I am not that much interested in them (usually the store front UI stuff), or I haven’t got any idea yet as to how to implement