The quick and dirty way is: var fs = require(‘fs’); fs.writeFile(“/tmp/test”, “Hey there!”, function(err) { if(err) { console.log(err); } else { console.log(“The file was saved!”); } }); but […]
Quick tip: Conditions for addAttributeToFilter in Magento collections
As probably you know (or maybe not) in Magento you can add your own filters to every collection, basically it looks like: $collection = Mage::getModel(‘catalog/product’)->getCollection(); $collection->addAttributeToFilter(‘myfield’, array(‘eq’ => […]
Tutorial: How to create Amazon Fulfillment order using php?
Follow my steps and you will get working service:
Quick tip: PHP Extensions “0” must be loaded error in Magento install
Such error happens in 1.7.x branch (I saw it in 1.7.2), when entering database parameters you’re seeing “PHP Extensions “0” must be loaded” instead of next step. This […]
Quicktip: Magento 1.7.0.2 shows Database server does not support InnoDB storage engine
During configuration of Magento 1.7.0.2 (in fact whole 1.7.x branch) you may encounter such error: Database server does not support InnoDB storage engine Of course your MySQL server […]
Quick tip: Ajax filter is not working in Magento grid?
It is a common issue, you added: $this->setUseAjax(true); but filtering just shows ajax spinner and not loading content? Check your grid class ([COMPANY]_[MODULE]_Block_Adminhtml_[CONTROLLER]_Grid extending from Mage_Adminhtml_Block_Widget_Grid) and if […]
Quick tip: Redirect to admin product edit at specified tab in Magento
It’s quite easy if you know how to do it, if not use this snippet: $this->_redirect(‘adminhtml/catalog_product/edit’, array(‘id’ => $productid, ‘active_tab’ => ‘mytab’)); It works in every controller extending […]
Zmiana jezyka
Po ponad dwóch latach prowadzenia bloga postanowiłem zmienić jego koncepcję – pierwotną ideą było pisanie o rzeczach które trudno wygooglować albo do których nie udało mi się znaleźć […]
How to use MySQL to search in php serialized fields
Well, first rule – you should not do this. But if there is good reason, consider using such query for searching in index-based arrays: SELECT * FROM table […]