Archive for September, 2009

Creating a new Product Attribute and then using it on a page in Magento 0

September 29th, 2009

Creating a new product attribute and using it when you’re displaying a product turns out to be fairly simple – but I know for us at iFuel – and I think for lots of others based on the posts you see around the net, it ends up not being as simple as it seems.

For this example, we’ll create a new attribute called “ingredients”.  We need this to be a text field (text area to be exact) that Magento admins can enter the product ingredients.  Then we’ll need to be able to access this text when we display the product.

Attributes

Attributes are single pieces of information that can be assigned to any of the entities (models) in the Magento system.  There is an extensive user interface for creating and maintaining attributes and attribute sets for products.  But you can actually create attributes for other entity types, like categories, too.  (Creating an attribute for a category has to be done right in the database – I’ll try to cover that in a future post).

To create an attribute:

more

IIS LogParser 0

September 22nd, 2009

I recently had to analyze how much static data the web server was sending out on a daily basis.  We wanted to try to get a sense of what it would cost to host all this static content on the new Amazon Cloudfront CDN (content delivery network).

I knew there had to be something out there, but I didn’t know there was something right in the IIS 6 resource kit called LogParser.

There are a bunch of options in log parser, but the one I thought was way cool was the ability to basically “query” the log.  For example:

LogParser “Select count(*), sum(sc-bytes) from d:\logs\w3svc1\ex090922.log where cs-uri-stem like ‘%.jpg’ or cs-uri-stem like ‘%.gif’ or cs-uri-stem like ‘%.swf’ or cs-uri-stem like ‘%.css’ or cs-uri-stem like ‘%.js’ or cs-uri-stem like ‘%.pdf’ or cs-uri-stem like ‘%.png’ or cs-uri-stem like ‘%.cur’”
returns:

more

Tools I can’t live without 0

September 17th, 2009

Updated: 10/14/2009

Over the years I’ve collected together a list of the tools I use all the time. I know there are lots of other lists like this out there, but, well, they’re not mine!!

I’m going to try to keep adding to this list on a regular basis as I find new tools, or decide to move on from others.

more

iFuel Standardizes on Magento Commerce 0

September 10th, 2009

After using many many commerce packages – and WRITING many many commerce packages from scratch, we’ve standardized on Magento Commerce for all new e-commerce sites.  It’s an awesome platform, with huge potential for customization and extension.  The list of existing modules (plug-ins basically) is very large and growing all the time.  This is the way to put up new e-commerce sites, no question about it!

We’ll be posting lots and lots of Magento information in the weeks and months to come as we continue on our journey with this great tool!

Adding to the Cart with a jQuery Ajax Call in Magento 8

September 10th, 2009

So, Ajax being the thing and all, I was hunting for a way to add an item to the cart using an Ajax call in Magento.  Recently, I noticed there was a module that apparently does this, but either I hadn’t seen that or it didn’t exist yet when I wrote this, so I hacked my way through it.

PHP isn’t my primary language – I come from the ASP, ASP.Net, C# world, but Magento was compelling enough that I’ve taken the leap.  I’m sure there are lots of things I could be doing better/differently here so if you’ve got some suggestions, I’m all ears!

Add to Cart Page

So first I needed an “Add to Cart” page (called – addToCart.php) that could be called from the client.  This page returns a result in JSON format.  The actual page also returns related items so we can try to cross sell the user, but I’ve removed that in this sample to make it simpler.

more