Nov 30 2012
Magento add comment to order history
In Magento you have a useful method in Mage_Sales_Model_Order::addStatusHistoryComment() which will add a comment and an optional order status.
1 2 3 4 5 6 |
$incrementId = '300000018'; /* @var $order Mage_Sales_Model_Order */ $order = Mage::getModel('sales/order')->loadByIncrementId($incrementId); $comment = 'My order comment'; $order->addStatusHistoryComment($this->__($comment)); $order->save(); |
If you add the second parameter to the method the order status will be updated.
Method header:
1 2 3 |
public function addStatusHistoryComment($comment, $status = false) { } |
Nov 30 2012
Programming jokes
Why do programmers always mix up Halloween and Christmas?
A: Because Oct 31 == Dec 25!
A man is smoking a cigarette and blowing smoke rings into the air. His girlfriend becomes irritated with the smoke and says, “Can’t you see the warning on the cigarette pack? Smoking is hazardous to your health!”
To which the man replies, “I am a programmer. We don’t worry about warnings; we only worry about errors.”
Programming is like sex:
One mistake and you have to support it for the rest of your life.
Eight bytes walk into a bar. The bartender asks, “Can I get you anything?”
“Yeah,” reply the bytes. “Make us a double.”
By Iulian Fenici • Funny things • 0