Blog

Zencart Plugin Framework – Day 5 – Introducing the template blocks/holders

With ZePLUF, I wanted to solve ONE issue that has been bugging me for years working with Zencart: the template editing issue.

Thinking back to the last time you installed a module that adds some new element(s) on your site, think of the process of doing it (in fact, just open that plugin’s README file):

  1. Edit the file includes/templates/YOUR_TEMPLATE/templates/tpl_product_info.php
  2. Find this line “blah blah blah”
  3. Add right about it the code below: “blah blah some code you may don’t event understand”

What is wrong with? Well, many. Think of this:

  1. 3 months later, you now do not want to use that plugin anymore and want to remove it, can you remember which files you edited to install it?
  2. You want to temporarily disable this plugin, but oh no you find out this plugin has no on/off switch, you will have to go to the exact template file(s) to remove it
  3. You want to move this plugin (the newsletter box) for example, to another place, what do you do?

Eventually, installing and removing plugins on your site will leave you with lots of garbage and useless files and such.

ZePLUF introduces the idea of template blocks, or we’d like to call it “holders” . It’s not a brand new idea never been done before, but it’s the first time something like it is introduced into Zencart, and it’s sexy. The “holders” in ZePLUF let you put PLAIN and SIMPLE HTML comments into your template, and the plugins can be hooked into this holders to generate views.

More on that will be covered soon, but for now, enjoy this sexy code:

Read More →

Updates 6/27/2012

Today we want to announce some super cool news for the developers of Zencart, it’s exciting for us to announce several updates:

1. The Zencart Plugin Framework will now support frontend controller as well. It means that as a developer now you can add new “pages” into the zencart site without going through the usual hassles. More on this later in a separate post.

2. Our CSS Javascript loader now supports adding library on the fly, this will give the devs a way to use the libs that are not included by default on the CJLoader package. Again, more on this later in a separate post

3. Last but not least, as you can see we are still working on our site. A store will soon be added to the site which will features many Free and Commercial modules we have been working on for Zencart.

Read More →

Zencart Plugin Framework – Day 4 – Working with templates

Working with Zencart templates can be a real pain for store owners and even developers; especially when you install plugin that needs to display something on the store. Usually you will have to edit a template file, put a line of code to pull that plugin’s template file. What happens when you decide that you don’t want to use that plugin anymore and want to remove it? It’s not an easy task either, you will have to track down all the files you made changes to revert them back to previous stage, which can be years ago (and sometimes it’s not even you who installed the plugin in the first place, which further complicates things).

In our years of working with Zencart, we have seen so many people struggled to install a simple plugin. All Zencart store owners seem to have to take a crash course in PHP, HTML and Zencart structure in general. But do they have to? Is it really necessary for them to do so? The answer, in our opinion, is a big NO. What’s so beautiful about WordPress is that almost 99% of its plugins are just plug-and-play, so simple, so straight forward, so effort less. It’s not very do-able with the current Zencart’s structure which is lacking lots of “hooks” for 3rd party modules to plugin in, but we try to make that happens, at least within the template.

Our Zencart Plugin Framework(ZePLUF) was designed with the end users in mind, and by end users we do mean real store owners with zero to nil PHP or Zencart’s internal structure knowledge. ZePLUF introduces what has been the norm in most modern framework: the “hooks” inside. the views (templates). In ZePLUF, these are called “holders” because they are basically place holders which can be input with any display text. A carefully thought out and coded template should already contain all these place holders in the appropriate position which the store owners when installing a new module can decide to use those pre-placed “holders” to render a certain view from the plugin. Obviously, the store owner can also easily place a new “holder” if he or she wants.
There are 2 ways to place a holder into a template file:

Option 1 (PHP code)

echo $riview->get('holder')->get('slot_name');

Slot name can be any thing you want, but it will act as a unique identifier for the plugins and other codes to input the content into it

Option 2 (HTML code)

Alternatively, it’s also possible to simply put a simple HTML code as shown above and let ZePLUF parse it for you. You will have to change the configuration of riCore to turn the “parse_holders” to true, however.

Read More →

Zencart Plugin Framework – Day 3 – Understanding plugin’s structure

Today is a special day for the devs, I will explain the structure of a standard ZePLUF plugin so you can easily develop your own plugin. You will find how easy and quick it is to create anything you need with this new framework.

If possible, all plugin files should be placed under plugins/yourPluginName to avoid conflicts with other plugins and to keep things organized. Please make sure that you name your plugin folder using the camelCase format.

Read More →

Zencart Plugin Framework – Day 2 – Configuration and Plugin Installation

On day 1, I have introduced to your our new Zencart Plugin Framework, what you will get from it and how to install it, today I will cover the configuration of the framework and how to install plugins written for it. Boy, this will be a short day because installation of plugins using ZePLUF will be so simple.

Read More →

WordPress on the go

Wordpress on the go
The reason why WordPress has become so popular is that it has:

  1. Intuitive UI
  2. Huge number of themes and plugins, both free and commercial
  3. Superb support on multiple platforms

For those who are using WordPress or plan to use it, note that you now can easily your WordPress site easily on your smartphone with WordPress’s free mobile apps:

http://android.wordpress.org
http://ios.wordpress.org
http://blackberry.wordpress.org
windowsphone.wordpress.org
nokia.wordpress.org

Read More →

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:

  1. 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.
  2. 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.
  3. 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.

Read More →

Get categories ordered by meta key on WordPress

For our website, we are using WordPress (we used to use Zencart before, but now we switched to WordPress and will only use Zencart for the store section). So for our own purpose we installed a WordPress plugin called Category Custom Fields which can add unlimited custom fields to any cateogry/taxonomy.

The problem with the plugin though, was that there was no way we could order the categories by those extra custom fields (this is true as of the date this article is written).

Read More →

creativy-mind

Taming The Wild Mind

Myths have developed around and researchers have studied how the human brain juggles creativity and organization. Popular theory tells us that the left brain is structured and logical, while the right brain is artistic and imaginative, and that all human beings use predominantly one side of the other.

Working in a creative field means challenging that theory, or else challenging the schedules and deadlines that managers impose on writers, designers and other creatives. As a project manager in a UX design agency, as well as a writer, I believe it is necessary to challenge both the assumptions about schedules and the belief that creativity implies disorganization.

Read More →

WordPress permanent links not working? GoDaddy issue?

After moving my dev wordpress to its new home, and something very weird happened: some, just some, of the links were not working (for example, the domain.com/contact page is not working while other pages are working). They are all pages (and some are categories links as well), some working, some not, no pattern it seems.

I was wondering if there was something wrong with my settings or if I messed up my .htaccess file:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

The host, GoDaddy, is infamous with delay in updating .htaccess, but I didn’t know if it was the case or not. Surely if that happened the whole thing wouldn’t work at all, but here we have some work, some didn’t.

After struggling almost 30 minutes with this issue and even posted this on stackoverflow, I found out the cause. I had a file named contact.php, after i renamed it old.contact.php domain.com/contact link started working. Hope this will save others’ time who may run into the same situation.


Read More →