Zencart Plugin Framework – Day 1 – Installation
Today I’m gonna post the first post of a series of posts on our newly released Zencart Plugin Framework (ZePLUF) which has been built to make working with Zencart much easier.
After working for years with Zencart, we have felt that even though it’s a great shopping cart, it has many limits:
- Plugins: the way it is now, installing a plugin usually involves copying the plugin files into many different places in the cart, it’s complicated and error-prone. Another issue is that when you later remove the ones you don’t need, it’s very easy to leave some thing behind not noticed.
- Translation: Zencart is using php “defines” to allow the creation of multi language sites. The issue is that this method is tedious for developers, and very error-prone for normal users.
- Templating: Zencart’s current template system doesn’t allow us to easily “inject” a piece of code into it. To put it simply in plain English, if I have a plugin which will display the top 10 products on my homepage, I will have to edit the homepage framework and put some code in. Later, if I decide to remove the plugin, I obviously have to edit the files again to remove the code. This complicates things and makes working with Zencart much more difficult than it should be.
The Zencart Plugin Framework is developed to solve all those above issues and more. So now with that in mind, if you are interested in it, lets get started with the installation process which is not that complicated.
You will need PHP 5.3 or newer to be able to use ZePLUF. The reason is that this plugin makes use of a bunch of Symfony 2.0 bundles which require PHP 5.3 or newer to work.
The plugin is put on GitHub at: https://github.com/yellow1912/ZenCartPluginFramework
There are 2 ways to install it: you can either clone the git* repo (which allows you to use the latest code) if you are familiar with Git, or you can visit the download section to grab a package.
* Note that if you go for the git option, you will have to get all the sub modules as well. You can do “php install/vendors.php” via the git bash console to pull all these modules. Make sure that you get EVERY submodule, sometimes for some reason 1 or 2 module may not be dowloaded.
Create a folder named “plugins” in your Zencart’s root folder. This “plugins” folder should be on the SAME level with your admin and includes folders.
The whole ZePLUF folders/files should be placed inside this plugins folder.
You will find inside the ZePLUF package you downloaded, there is a folder named install, inside this folder you should find:
- zencart/includes folder: all files/folders inside this folder should be moved to your Zencart’s includes folder which should be right at the root of your Zencart.
- zencart/your_admin_folder folder: all files/folders inside this folder should be moved to your Zencart’s admin folder.
- zencart/index.php file: this file should be moved (and overwrite) your current Zencart’s index.php. If you have edited your index.php file before for some other purposes, you may need merge the 2 files using a software such as BeyondCompare or WinMerge.
- zencart/ri.php file: this file should be moved to your current Zencart’s root.
And that’s it, the installation should be completed now. If you run into errors such as “blank page error” you may want to turn on the debug and see what’s happening.
If you want us to do it for you, we also offer commercial installation service which we will post a link here soon.
That’s it for today and on day 2 we will learn how to install plugins with this framework and how to use some of its basic features.