Tag Archives: Magento

Magento PHP developer’s guide

It really was a long time since my last review of books about Magento, in the meanwhile some of you may know that I’ve been to a Magento U class in Berlin and I’ve taken 3 of the 4 Magento certifications. I’ve been through some really busy months but now I should be back on track. Continue reading

Instant Magento performance optimization howto

I just finished reading the Instant Magento performance optimization howto ebook by Packt and I’m about to write a quick review.

First of all this book is short (50 pages), quick and easy to read. Don’t misunderstand me, for me this is a big plus: Magento is a big universe and for me it’s better to have more specialized books instead of one big book covering everything (which is actually impossible).

Performance are also a big trouble for everyone who works with Magento so anyway this book is a little investment for a nice and complete (also if not very deep) reading (but also a practical manual) on Magento performance overview.

The book covers all the aspects of the optimizations, from CSS/Javascript compression to logging to compiling etc. It also covers some advanced topics like mysql configurations and clustering but here I would have liked to see more details (on mysql tuning we probably need more than just a my.cnf sample and on clustering we’d need to talk about percona, how to configure mysql clusters with practical configurations or link to video tutorials).

I’d rate this book 7.5/10, as an advanced developer I would have liked more advanced details but probably this should have gone beyond the scope of the book itself so at the end… it’s totally worth its money and most of all it’s a good read for all the kind of Magento workers, from designers to coders to system managers.

So you want PayPal Express Checkout on Magento 1.3?

And you get some weird errors…
open your app/code/core/Mage/Paypal/Model/Api/Nvp.php file and search for SOLUTIONTYPE, change its value to “mark”.

Edit your PayPal preferences from Magento backend and use this PayPal Url:

You should be done.
Good luck.

“Mastering Magento” first look

I just received the Mastering Magento ebook from Packt a few hours ago, I’m really out of time in these weeks but I wanted to share a couple of thoughts from the first look at this book.

If you’re a Magento developer, than get it, from a really quick view (I’m gonna review it later) I think I’ll buy the printed copy to keep on my desk, as a senior Magento developer I already know most of the things writting in the book but it is really well written, full of useful information and it will become helpful when you’ve to do something quick but you don’t remenber exactly how to do it or a particular meaning of a Magento terminology.

It seems to cover all the main areas and it has a really lifesaver section which is the pre-launch checklist.
Also very useful if you’re teaching a junior developer/designer and you need a deeper introduction to Magento (this book is not for who didn’t see Magento before in his life).

Another thing I think, it could be easily split in 2 version cause the introduction says that the book is intended for developers and store owners but I think that store owners should not be bothered with all the dev stuff, anyway part of the book would be really perfect to be given to store owners saying “hey this is the Magento manual” :-)

Magento 2.0

News are coming out about our new loved/hated Magento major (and it’s gonna be really major) release: Magento2.

First of all a technical overview video, not too recent actually:

One amazing thing is that the development moved to github:
with all the benefits we know.

Another nice improvement is that we have public tests for the test addicted:

A couple of nice articles about Magento 2.0:

Magento 2.0 is scheduled for Q4.2012, let’s see what is going to happen! :)

Magento reindexer issue and very bad fix

On a big website, while Magento (this was a Professional 1.10.something) is reindexing (work done by a cron job) every page (viewed from the browser) seems to try to reindex the products it shows, that ends in a duplicate key error on an index temporary table (catalog_product_index_price_tmp), I needed a rough and quickfix I opened app\code\core\Mage\Index\Model\Resource\Helper\Abstract.php and added a try/catch to the insertFromSelect method, making it become:

public function insertFromSelect($select, $destTable, array $columns, $readToIndex = true)
		try {
        if ($readToIndex) {
            $from   = $this->_getWriteAdapter();
            $to     = $this->_getIndexAdapter();
        } else {
            $from   = $this->_getIndexAdapter();
            $to     = $this->_getWriteAdapter();

        if ($this->useDisableKeys()) {
        if ($from === $to) {
            $query = $select->insertFromSelect($destTable, $columns);
        } else {
            $stmt = $from->query($select);
            $data = array();
            $counter = 0;
            while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
                $data[] = $row;
                if ($counter>2000) {
                    $to->insertArray($destTable, $columns, $data);
                    $data = array();
                    $counter = 0;
            if (!empty($data)) {
                $to->insertArray($destTable, $columns, $data);
        if ($this->useDisableKeys()) {
		} catch (Exception $e) {}
        return $this;

It is bad but now it’s working, oh god.