Chris Pollock

Chris Pollock - web developer & ecommerce entrepreneur
undivided… my thoughts on world, family, church, business, technology and Jesus Christ (all in all)

Make DOMPDF work with Magento

I’m currently working on a project where I wanted to use DOMPDF to export html from magento.  With some help from some folks who got DOMPDF to work with Zend I was able to get it working with Magneto.

Step 1

Copy the dompdf folder to the lib directory of your magento install.

Step 2

Edit app/Mage.php to include the following code

include_once 'dompdf/';

This goes around line 52 inside the else statement right after

 include_once "Varien/Autoload.php";

Step 3

Use the code.  Here’s an example of what I  am doing inside on of my custom contollers

public function printAction(){
        if ($quote = $this->_iniQuote()) {
            $html = $this->getLayout()->createBlock('crm/quotes_print')->toHtml();
            $dompdf = new DOMPDF();

Basically that’s it.  Pretty straight forward and seems to work like a charm.

NOTE:  This was done using DOMPDF 0.6.0 beta1 and Magneto

[ Leave a Comment ]

Simplified Building enters a New Era


You haven’t heard much from me over the past couple of months, and that’s because our flag ship web site, Simplified Building Concepts has undergone a complete overhaul.  Last year I release Simplified Safety, my first foray into Merging Magento and Expression Engine.  Simplified Building is the next generation of that project.

Hopefully I’ll be getting some time over the next couple of weeks to blog about some of the adventure. 

[ Leave a Comment ]

My Latest Creation: Simplified Safety

Just about 18 months ago we conceived of a new web site that was focused on safety solutions.  As we conducted business on Simplified Building Concepts we saw an increased emphasis on safety railing and safety products.   This led us to create an entire site that focused on providing safety solutions and advice.  The site was designed in collaborations with Squared Eye.   Matthew Smith from Squared Eye did a fantastic job working with me to put together a site that is both beautiful and usable.  I highly recommend his services.

I welcome you to visit the site and give feedback (use the black tab on the right side).  In the future I plan on releasing some posts on the ins and outs of the architecture of the site.

Here’s a bit of information about the site:

Simplified Safety is a company specializing in safety products and advice.  We aim to provide customers with tested, top quality safety gear and the appropriate advice to identify the products that are needed by each individual customer.  Working closely with each customer to arrive at a tailored safety solution is how we hope to set ourselves apart in the industry.  Here are a few examples of the safety products we supply: Guardrails, Skylight Protection, Lifeline Systems, Personal Protection Equipment, Harnesses, Lanyards, and more.



[ Leave a Comment ]

Meetup with EECommerce Developers

Last week I was in the UK on business and had the opportunity to meet up with some of the leads working on the EECommerce module that will bridge Expression Engine and Magento Ecommerce.  There were several purposes in the meeting 1) for me to communicate a very particular need I had in bridging multiple stores in Magento with multiple sites (via the Multiple Site Manager) in Expression Engine.  2) The other purpose was for me to get a handle on the project and what they were trying to accomplish.  Based on that meeting with Lee and Greg, here are some of the things I learned about EECommerce.

EECommerce is trying to make it possible to have the entire user/developer experience defined within EE.

The goal of the module is to port everything necessary to have a seamless shopping cart experience without ever leaving Expression Engine.  While that was not necessarily what I was looking for in merging the two systems together, there is a lot of potential in this approach as it will mean that the designer/develop does not have to mess with Magento’s somewhat confusing templating system.  Their goal is to make it so that you can define your entire store in EE templates, using the plug-in tags to harness Magento’s inherent functionality.  Of course you would still access Magento’s backend (e.g. product entry, order management) directly, but the actual user experience would be defined in Expression Engine.

EECommerce will be a complete encapsulation of the Magento API.. along with several extensions.

EECommerce’s tag system will encompass everything that can be done through Magento’s API and more.  This is by no means just a subset of Magneto functionality that is being brought into EE.  Far from being a subset, they will actually be extending the API in several ways that can be used with or without Expression Engine (as a developer I like this).

PHP UK seems to have passion for the project and a desire to garner community feedback.

For my own part, these guys drove a couple of hours to meet up with me at my business headquarters.  The drove up and listened as I explained the level of user integration that I was looking for between the two systems.  I laid out my architecture and they responded with what they believed their module would be able to accomplish.  They also assured me that they would talk to their developers and give me a better idea of when I might expect to see and beta test some of the features that I need to have developed for a forthcoming web site that I’m developing.

EECommerce was a bit more undeveloped than I might have hoped

I was hoping to see EECommerce a bit more developed when I met up with PHP UK.  For sure, they showed me that the module was working “in principal” but it seems that there are many bugs to get worked through on a bridge that is this involved.  Although they are hopeful to have something a bit more polished by some of the upcoming MAGE:Camp it seems as though they will have their work cut out for them.  In short, don’t plan on using this module in your ecommerce project that needs to be deployed next month.

A Word About Price

Clearly some of the biggest reaction in the community has come at the sticker shock of the EECommerce module.  Obviously everyone loves getting something for nothing, but as you and I know there is nothing that is truly free.  Everything cost something (even if you’re not the one who has to pay).  As an ecommerce entrepreneur, not just a developer, I think there is some real business value in the module that is being developed.  If built correctly, the module could be used to rapidly deploy ecommerce micro sites.  The tool has the potential (we’ll see when we get there) to greatly speed up the development of ecommerce sites that are simple and complex.

The Jury is Out

At the end of the day, the jury is still out.  Until the beta truly gets out there and a the developer community really begins to put some pressure on the module, its hard to see what will come of EECommerce.  I for one, am willing to give it a go and am looking forward to seeing if these guys can pull together a supported tool that helps make online commerce even easier by bringing the feature richness of Magento into the flexibility of Expression Engine.

If you have questions about my meeting and what I was able to see, please post your questions in the comments and I’ll try to address them in a timely manner.

[ Leave a Comment ]

Magento: Jump back to Payment Screen when Payment Declined

On my installation of Magento, I wanted to return the user to the payment screen when their card was declined.  This is a bit of a hack, but it does work.  I simply inserted some custom JavaScript into the opcheckout.js file which is located in /skin/frontend/default/default/js/

I searched my error message for the word "declined" and based on that, push the user back to the payment screen just before showing the alert box.

if (msg.indexOf("declined") > -1)

I insert this around line 760, right before the "alert(msg)".


Technorati Tags:

[ Leave a Comment ]

Magento Custom.css

I am making the switch to Magento.  In the process I'm sure I'll be learning a lot.  I'm going to be posting what I learn here for a couple of reasons:

1. for my own documentation, so I can look back and see what I did
2. for your instruction, if you run into the same problem I did I hope this helps.

Custom.css is not included by default.

Add the following line to your page.xml

<action method="addCss"><stylesheet>css/custom.css</stylesheet></action>

Then you will need to update your cache

Go to the Admin.  Click System >> Cache Management.  Select "Refresh" from the list and click save in the upper right. 

At this point, any changes you see in custom should start appearing in you site.

[ Leave a Comment ]


Things I see

Walk about near Ugley.PhotoIs there anything more springy than daffodils? £2 at Tesco is hard to pass up. #englandtrip2017 #springIMG_1560.JPGIMG_1537.JPGIMG_1567.JPGIMG_1614.JPGIMG_1608.JPGPhotoOliver PowerLucas power!Big bathtub fun. #lifewithboysTucked himself in like this on my bed this morning :relieved:#lifewithboysNeat tree in bloom. Looked like pussy willow blooms but this when opened. Bees were covered with pollen. #englandtrip2017English spring and a big swing. #englandtrip2017

Chris Pollock

Web Developer - proficient in both PHP and ASP.NET.
Rochester, New York

View my web developement site.

View Chris Pollock's LinkedIn profile

My Pictures

Walk about near Ugley.PhotoIs there anything more springy than daffodils? £2 at Tesco is hard to pass up. #englandtrip2017 #springIMG_1560.JPGIMG_1537.JPGIMG_1567.JPGIMG_1614.JPGIMG_1608.JPGPhotoOliver PowerLucas power!Big bathtub fun. #lifewithboysTucked himself in like this on my bed this morning :relieved:#lifewithboysNeat tree in bloom. Looked like pussy willow blooms but this when opened. Bees were covered with pollen. #englandtrip2017English spring and a big swing. #englandtrip2017