multiple stores
I have been thinking a bit more about the mutlistore mod and if/how this would work in ZenMagick.
As far as I can see it comes down to two pieces of functionality:
- Theme switching based on the request hostname
- Serving individual catalogs for different hosts
The first point is actually already there - theme switching is something ZenMagick can already do for quite some time. I guess it would take about 10 minutes to write a simple plugin that allows to switch between themes based on the hostname ($_SERVER['HTTP_HOST']) or any other criteria in the request.
The second is going to be a bit harder. I played around a bit and it is actually possible to extend ZMCategories in a plugin to restrict categories according to the rules defined in the multistore mod.
The second service to be modified is ZMProducts and perhaps hard is not the correct term here. It’s rather tedious to modify all the SQL to restrict products based on the category rules.
So, even though I implemented ZenMagick in a way to allow this sort of extension, I do not really like it. It is a good thing to have if you want to customize your store. It’s not so good any more if used in plugins. There is no way to predict behaviour if two or more plugins try to replace the same core class. In the end, only one class can win (the one of the plugin loaded last)
So currently I think if someone feels like it a plugin is ok, but perhaps just as a short term solution. In the long run, proper catalog management would be nice.
A catalog in this context would contain categories and products. However, to make this work really well, they relationship between categories would have to be extracted into a separate table. That way the same category could be in multiple catalogs but have a different parent and different children. In a way this would be similar to the way products are associated with categories. Way to go I think…
