While phrases like “should we be be doing this in 2016” abound in engineering discussions, down in the trenches an arbitrary SQL query is often the fastest, most expedient way to get at the data you want. While I still regularly encourage developers new to Magento to embrace using the models and API resource models when [...]
astorm
Two good Stack Exchange answers from Raphael at Digital Pianism covering how to add a custom icon to your Magento Admin Menu Items. In short – these menu items use a custom font character, defined in svg file that’s (somehow? via LESS CSS?) converted to an embedded OpenType font. This custom font uses the Private Use Area of [...]
astorm
In the first article of this series, we described how to create a simple MVC/MVVM endpoint in Magento 2. Implicit, but unstated, was that we were setting up an endpoint for Magento's frontend cart application. While the backend admin application uses the same MVC/MVVM/View
astorm
In Magento 2, when you’re working in phtml template files, you’ll see two ways to make method calls to the block object, one using $this, another using $block $this->someMethodCall(); $block->someMethodCall(); The $block variable is new in Magento 2. It contains a reference to an instance of a template’s block [...]
astorm
The Magento backend application, (sometimes called "The Admin" or adminhtml area), is where a system owner manages their Magento store. This is where users interact with web forms to add new products, change configurations, etc. Magento is a multiuser application -- i.e. a
astorm
Creating an MCV/MVVM landing page for Magento 2’s frontend cart application is relatively simple. You create a routes.xml file so your module can “claim” a frontname, then then create a controller class that’s named correctly to catch a particular URL pattern. This is even easier with pestle, my PHP CLI module [...]
astorm
Just a quick bit of advice for folks getting into Magento 2 development, which probably applies to Magento 2 development as well. If you’re building backend admin components, it’s a good idea to not rely on the default, Super User admin account when you’re developing and testing. There’s a few parts of the admin [...]
astorm
One last bit on the area setting object in Magento 2. There were times in Magento 1 where it was necessary to temporarily pretend you were running code in one area, even though you were in another. One famous example of this was using Magento’s catalog/product objects to directly save product information while on the frontend. In [...]
astorm
Reader Vinai Kopp (of Mage2Katas fame) wrote in with a interesting bit of functionality in the MagentoFrameworkAppState class we talked about in the Fixing Area code Not Set Exceptions quickie. Specifically, Vinai had a bit of code that was shared between a command line context, and a web context, and if he tried setting the area code [...]
astorm
nexcess/magento-alarmbell Meanwhile, back in the real world, away from the bleeding edge of Magento 2, Nexcess has just released a simple-but-useful open-source extension that will log and notify users when there have been been admin user changes made to their Magento system. I’m not responsible for maintaining any active Magento 1 [...]
astorm
Carved out some time this weekend to add Repository generating code to pestle’s generate_crud_model command. Now, in addition to creating your standard Magento 2 Model/ResourceModel/Collection objects, you’ll also get a repository for your object with the de-facto standard save, getById, getList, delete, and deleteById [...]
astorm
Repository Filter Groups Applied Inconsistently · Issue #4287 · magento/magento2 My bug report to Magento on the previously mention filter group vs. filter inconsistency. Hopefully it’s not ignored.
astorm
I touched on this in my longer Magento 2: Understanding Object Repositories tutorial, but it’s worth repeating. The relationship between individual filters and filter groups in Magento 2 repositories is inconsistent. There’s some tribal wisdom floating around that filters should be applied as OR conditions, and filter groups [...]
astorm
One question I keep getting from new Magento 2 developers, (and we're all new Magento 2 developers) is, "How should I organize my project files?". Since Magento has heavily restructured code organization around Composer, it's not always clear how files should be organized
astorm
In our last article, we talked a bit about Magento 2's use of Composer, and touched on the Composer meta-package installation method. One high level take away was, when you use Composer's create-project method to start a new Magento project, you are
astorm
MageScotch — A Magento 1 and Magento 2 Vagrant box Another “ready to go” Magento 2 (also Magento 1!) vagrant VM – although this one is offered and maintained by Joshua Warren, so it’s worth more than a casual look. It seems to be based on the Scotch Box vagrant project, which purports to offer a ready to go [...]
astorm
I recently started a new series over on my main website that sets out to explain everything a Magento 2 developer would need to know about composer. The first article covers setting up a satis mirror of repo.magento.com, Magento 2’s official composer repository. An ideal deployment system wouldn’t just mirror Magento [...]
astorm
As Magento 2 approaches its first half-birthday, one thing is clear: Magento 2 is leaning heavily on PHP Composer for its developer workflow, and for the merchant facing Marketplace.
astorm
If you’re giving Magento’s new Marketplace feature a spin for the first time, you may be surprised to find that it requires you have your three Magento 2 cron jobs running. There’s a few reasons for this. The first is a clever solution to the perennial PHP permissions problems when running commands and creating files as [...]
astorm
If you’re trying out Magento’s new Marketplace feature (essentially a ground up redesign, both backend and UX, for Magento Connect), you may run into a 404 error when you try to access the “Web Setup Wizard” (which is where you can access Component Manager, which is what lets you add purchases to your system). [...]
astorm