Maybe someone will find it usefull:


It is a bit different then method showed in previous post – this time its not transactional email sent at demand, but we will catch event fired after invoice is generated. So (I suppose you have your module already) in etc/config.xml add:

Then create your class at app/code/local/YourVendor/YourModule/Model/Observer.php (or use existing one) and add new method:

And invoice will be attached to email defined at:

Zrzut ekranu 2015-01-14 o 19.12.17

Seems to be complex, but its not that bad:

About $vars variable – in this one you can put everything which is set inside email template as variables.

If you are using MAMP and trying to execute doctrine:schema:create or anything db related you may encounter that error, solution is simple – you need to create symlink to mysql.sock:

Its not that bad, all you have to do is get Stock Object, update quantity and save again along with product:


Probably you are using git. And probably a day when you will add another repo is close. But standard git behavior is to use key located at ~/.ssh/id_rsa. And you just generated ~/.ssh/mynewkey and want to using for your host. So what to do? Just edit your ~/.ssh/config (if you don’t have it yes, create empty) and put:

And this is it, git clone should use mynewkey instead of id_rsa

The quick and dirty way is:

but of course you can use also:

You need to wait for the callback to ensure that the buffer is written to disk. It’s not buffered.

All data must be stored at the same time; you cannot perform sequential writes.

Creates a WriteStream, which is convenient because you don’t need to wait for a callback. But again, it’s not buffered.

As probably you know (or maybe not) in Magento you can add your own filters to every collection, basically it looks like:

So here is full list of conditions you may use:

1. “eq” – equals (x = 1): addAttributeToFilter(‘status’, array(‘eq’ => 1))
2. “neq” – not equals (x != 1): addAttributeToFilter(‘sku’, array(‘neq’ => ‘test’))
3. “like” – same as in sql, you can use % here: addAttributeToFilter(‘sku’, array(‘like’ => ‘%test%’))
4. “nlike” – not like: addAttributeToFilter(‘sku’, array(‘nlike’ => ‘%test%’))
5. “in” – same as IN() used in sql, accepts array of values: addAttributeToFilter(‘id’, array(‘in’ => array(1,2,3)))
6. “nin” – not in: addAttributeToFilter(‘id’, array(‘nin’ => array(1,2,3)))
7. “null” – field should equal to null: addAttributeToFilter(‘description’, ‘null’)
8. “notnull” – field should be different then null: addAttributeToFilter(‘description’, ‘notnull’)
9. “gt” – greater then (x > 1): addAttributeToFilter(‘id’, array(‘gt’ => 1))
10. “lt” – less then (x < 1): addAttributeToFilter(‘id’, array(‘lt’ =>1))
11. “gteq” – greater or equal (x >= 1): addAttributeToFilter(‘id’, array(‘gteq’ => 1))
12. “lteq” – less or equal (x <= 1): addAttributeToFilter(‘id’, array(‘lteq’ => 1))

If you want to see executed SQL try: