Regular

CI's Upload Library CodeIgniter's upload library allows you to specify allowable files on a case-by-case basis by simply crafting something like the following: $config['upload_path'] = './public/media/audio/'; $config['allowed_types'] = 'mp3'; $config['overwrite']= TRUE; $config['max_size'] = '5120'; $this->load->library('upload', $config); In this case, I specified that the allowable file types are mp3s (multiple types...

I always have to go digging to remember how to tap into Magento's events, so I'm writing this down, as much for my benefit as everyone else! In the example below, I'm creating an extension that notifies the Magento admin on a customer's account creation. Step 1: Create Extension <?xml...

I was having trouble locating an error produced by a particular PHP class in a rather cluttered web directory. Because I didn't have access to SSH, grepping was also unfeasible. As it turns out, PHP has a very useful class called ReflectionClass that has a number of very useful methods...

This morning I created a Remarketing Extension for Magento Community Edition and Magento Enterprise. This script will allow you to remarket products to customers that landed on your product detail detail and cart pages. It also targets the checkout success page so that your customers are not remarketed for products...

The Problem On a recent project, I was tasked with building a monogram tool that would allow visitors to preview and add a 3-letter monogram to various products in the store. The end result looked as displayed below. Pretty cool! After a few weeks, the fulfillment department noticed that many...

The Problem jsLint throws the error jQuery was used before it was defined. The Solution Add to the top of your script. Remove $ or jQuery if not using these references. /*jslint browser: true*/ /*global $, jQuery*/

The Problem Creating tar files on a Mac results in a ._* meta file for each file. To Solution To remove these files, cd to the extracted archive and: find . -name ""._*"" -print0 | xargs -0 rm -rf This will find any files that match the pattern ._*. Each...

The Problem We have very specific (zip-code level) tax rates for the state of Ohio. As a result, we had about 1,500 tax rates that we needed to apply to a specific rule. Importing the tax rates went well. However, whenever I'd try to the apply tax rates to the...