Another consequence of losing the global Mage class in Magento 2 is the loss of the getBaseDir method. Fortunatly, the team behind Magento 2 has a solution, the MagentoAppDir object. You can use this object to get the base directory of your Magento system. $object_manager = MagentoCoreModelObjectManager::getInstance(); $dir = [...]
astorm
Magento 1 was littered with translation functions. Helper objects, block objects, and the PHP global namespace all had a __ function or method. Magento 2 does away with this. Core team developers have removed the __ method from the base block and helper classes, leaving only the global __ function for translations. If that didn’t [...]
astorm
When you’re converting you Magento modules to Magento 2, make sure your helper classes have a _moduleName property. protected $_moduleName='Packagename_Modulename' I ran into an issue where the isModuleOutputEnabled method relied on this value being set. If the property isn’t there, Magento will attempt to infer a module name [...]
astorm
OpenERP Magento Connector — OpenERP Magento Connector documentation I’ve never used it, but it looks like some OpenERP folks are still supporting/developing a Magento connector. via Stefan Rijnhart
astorm
With the loss of the Mage class in Magento 2, you may be wondering how to instantiate a helper object. That is, the following will product an error in Magento 2 $helper = Mage::helper('core/data'); Similar to the object manager, Magento 2 has a helper factory which lets you instantiate helper methods. In fact, you use the object manager [...]
astorm
Recent builds of Magento 2 have done away with the global Mage class. There are pros and cons to this, and I feel a more in depth blog post stirring in my gut, but that will need to wait for another time. Of more immediate concern: without a Mage class, how does a developer instantiate model or magento-singleton object? The [...]
astorm
mysql – Force InnoDB to recheck foreign keys on a table/tables? – Stack Overflow Not strictly Magento related, but an interesting thread on Stack Overflow about checking your MySQL system for invalid foreign key data. (PostgreSQL folks: Please stop laughing)
astorm
I just grabbed the latest Magento 2 from source, and suddenly PHP was complaining about a method declaration PHP Fatal error: Declaration of MagentoCoreModelUrlProxy::setRequest() must be compatible with MagentoUrlInterface::setRequest(MagentoAppRequestInterface $request) in [...]
astorm
Post Deployment Database Tests Interesting series of tests Copious uses to ensure a Magento deployment went as intended.
astorm
If you’re not paying attention, eBay has been a little more proactive on the Magento 2 front. The code dumps are coming regularly to git. Of course, this means the shifts in architecture direction are also coming regularly to git. In Magento 1 we had module declaration files. These lived in app/etc/modules/*.xml and [...]
astorm
Speaking of COPIOUS This looks like an interesting Magento instance backup script from Dann.
astorm
COPIOUSLabs TechTalk: Scaling Magento I’ll try my best to make this tech talk — it should be interesting to see what a (super smart) non-partner agency has cooked up in the way of a scaling strategy.
astorm
Number [god I don’t know] in the “Reasons Magento/PHP drives you Crazy” series. Trying loading a product object that doesn’t exist. $product = Mage::getModel('catalog/product')->loadByAttribute('sku','NO SUCH SKU'); var_dump($product); You’ll find $product contains NULL. Now try loading an attribute [...]
astorm
At a partner only event in Chicago, members of eBay’s Magento team renewed their support for Magento 2. A few of the usual suspects were there, and a more general announcement has been promised. As for a release date? The usual. It’s interesting to look back to the Magento Developer’s Paradise conference in 2010, which [...]
astorm
speedupmate: if the time and price fits and mostly tasks that can be measured with days “Tasks that cab be measured with days” is the freelance programmer’s mantra.
astorm
Warby Parker Open Sources two Magento Extensions Besides being the useful/right “open-sourcey” thing to, it’s interesting to see the sort of problems a big scale site like Warby Parker decided to solve themselves, and the extra infrastructure tools (RabbitMQ) they used.
astorm
Magento’s objects (that inherit from Varien_Object) have special “magic” getter and setter methods implemented with PHP’s magic __call method. If you’ve got a Magento object, you can just set and get data like this $this->setFooBar('a value'); echo $this->getFooBar(); without any setFooBar or getFooBar [...]
astorm
In Magento 2, the base Varien_Object class no longer has a custom, internal _construct method. Blocks, Controllers, Models, Resource Models, and Collections still have an internal _construct, but that’s because the core team defined _construct methods on the various abstract base classes for those objects. $ ack '->_construct' [...]
astorm
I’ve been digging into Magento 2’s layout system, and there’s significant changes from Magento 1. Conceptually, it’s still a “nested tree” of elements, but instead of just blocks there’s now a second type of thing you can add to a layout called a container. Containers look like they’re [...]
astorm
Magento 2 has “web hooks” Looks like there’s a proposal in Magento 2 for webhooks, which appear to be a a way to have Magento automatically send an HTTP POST whenever an important business logic action (customer created, order created, etc.) occurs.
astorm