Archives of Uncategorized

Magento 2 Frontend: Adding Javascript and CSS via Layout XML

Layout system critiqued, let’s get back to the practical business of adding a front end file to our Magento module. Before we begin, per pervious articles in this series, the following assumes You’re working with developer mode enabled (SetEnv MAGE_MODE developer in your apache config) That you’ve disabled the full page caching in System -> Cache Management You […]

Working With Models in Magento 2

What Are Models? Models are a flexible, highly abstract class that represents business logic in your application.  Models in Magento 2 can be anything that is packaged up and labeled.  For instance, database tables are representative of models. Magento’s ORM demands that only models can work with data in the application.  Models in the scope of ORM […]

Magento 2: ORM

Magento 2 works in many ways to the Magento 1 ORM structure.  They still have models, resource models, and collections.  There are a few small differences, but the overall structure remains unchanged. Create a Module Create the following folders: app/code/Ecommage/OrmExample/etc/ app/code/Ecommage/OrmExample/Model/ Let’s register our module. In app/code/Ecommage/OrmExample/etc/module.xml, enter the following: <?xml version="1.0"?> <config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module […]