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
Last time we explored database access in Magento via creating simple Magento 2 CRUD objects, and we explored the various source files involved. While some of the window dressing has changed, Magento 1 developers probably felt right at home. Conceptually, Magento 1's Model/ResourceModel/Collection ORM
astorm
Sometimes, when you’re working with a Magento 2 command line script, you’ll see an uncaught exception that looks like the following. Area code not set: Area code must be set before starting a session Areas in Magento refer to different sections of an application (like frontend cart, or the adminhtml admin console) available [...]
astorm
If you’re being a good Magento 2 programmer, you’re not directly accessing an object manager instance. You’re using dependency injection to inject your objects in a constructor so future programmers will have a clear place to see a class’s dependencies, and change them if need be. But we know good programmers [...]
astorm
An Interesting Challenge for folks Using Magento 1 and PHP 7 Magento 1 doesn’t officially support PHP 7, but the changes needed to Magento’s core code to get this working aren’t too strenuous, and even third party extensions can be patched/modified to make this work. Whatever interesting here is the de-facto standard [...]
astorm
This one’s a follow up to my Magento 2: Understanding the Web API Architecture post. In that post I gloss over Magento’s oAuth implementation, and what I did say got several details wrong. This article aims to fix that. To understand Magento’s oAuth features, you need to understand the (related) integrations feature. To [...]
astorm