Continuing Our Open Source Contributions: Magento Order Status Adjustment Module v1.1
Earlier this year, we open-sourced our Magento Order Status Adjustment Module, and we heard from Tomasz Szmyt, one of our development team leads and Magento 2 developers at Creatuity about the construction of that module.
Tomasz is back now with more to tell us about version 1.1 of this module, which was just released this week. Here are the details in Tomasz’s own words:
In my previous article, I outlined how we came up with the idea and how we finished version 1.0 of our Magento Order Status Adjustment open-source module. As a result - we’ve published the module as a Composer package, available to anyone globally.
After receiving good internal and external feedback, we’ve decided that there are still some important features missing in the module. That’s how we’ve started Phase 2 of the Order Status Adjust module project.
What was lacking in the first version of the Order Status Adjust module
During the development of the first version, we’ve been actively choosing between deliverability on time, on budget, and providing a comprehensive solution. In the end - we delivered the module before our internal deadline, but we deferred some features.
List of features that we’ve seen beneficial but decided not to implement in the first version:
Order history entry for each applied rule
Rule Start and End Datetime
Introduction of more order fields to be used in the rules criteria
An easier way to plugin to our module to streamline the process of adding custom conditions
We were especially interested in the last one because it will allow all individuals (including Creatuity) to add new conditions without altering the core of the module.
We also decided to introduce Unit Tests to cover critical places (at least) in the whole module.
How we decided to work
The first iteration of the module was written from scratch by me. This time - I’ve decided that it would benefit our company to distribute development and quality assurance among other employees.
We’ve held a planning session, during which we’ve distributed tasks and decided who’ll be responsible for creating test scenarios and covering the entire module with manual and automatic testing.
Development Phase
Fortunately - the development of each of the features outlined before went quickly. We finished the development phase of the next version of the module in merely two weeks, while completing quite a bit of client work as well!
The first thing we finished was “Allow addition of new rules by other modules via XML.” We’ve revisited parts of the module that interact with rules and created a way to inject them via XML, as typical Magento 2 and Adobe Commerce extensions do.
The second thing, but the first done by someone other than myself was adding many new fields that can be validated when the order is being processed: “New attributes for rules creation”. It went pretty well, but at the same time - it was more challenging than it seemed at the start. Having a 2nd developer implement this feature meant they needed to become familiar with the whole module and they were able to provide valuable feedback to work with later.
The third feature was “Start and End Date” which took a while. On the surface - it looks pretty easy. But when we got to the fun that is “timezones” - it got complicated. As a result, we’ve decided to use the Store’s timezone for those fields. In the end - store owners do not care about GMT, but about their local timezone.
The last implemented feature was “Order History entry for applied rule”. The Order Status Adjust module was lacking that one heavily - it was difficult to track which rules were applied to an order and at what time. Now - it is really easy to distinguish every single rule used and how they’ve been applied during the order’s lifetime.
Do not forget about the last thing - Unit Tests. While unit tests are not sufficient by themselves, they can surely help to have fewer errors in the future.
Preparation of version 1.1.0 release
Theoretically - releasing a new version of the module is as simple as pushing a new tag to the GitHub repository. In reality, though, that’s only the final step.
In our practice, Quality Assurance is a must. The first release of the Order Status Adjust module was heavily verified and QA’d, but solely by me. This time - we took extra steps to ensure that we’ll deliver the best quality possible. That’s why we brought our QA engineers and testers into the process this time, just like we do on our client projects.
During the Quality Assurance process, all features were verified one by one. After performing many tests, we’ve come to the conclusion that the development phase was a success. We had no serious issues during QA! It was a bit shocking that no critical issues were found, but that just shows how careful we were during development and how many tests we conducted as we built the module.
Working for many years for many different clients has taught me one crucial thing - the best solution not to introduce tricky issues is to have developers familiar with the client’s business. To me - that’s a good explanation of what helped us keep errors to a minimum with version 1.1 of this module - we deeply understood our requirements and what we needed to build.
Summary
Now you see the true story - version 1.0 was only the beginning, development really became serious after the first public release. Only a couple of weeks after announcing the Order Status Adjust module for Magento 2 / Adobe Commerce - we’ve already added many new features. This isn’t the end, though - we have more ideas on how to improve not only the module but also our workflow when open sourcing new features for Magento and Adobe Commerce, which we will continue to share on GitHub and here on the Creatuity site.
Download the module, submit pull requests and improvement ideas on GitHub, schedule a consult with our team if you think this module could help your Magento or Adobe Commerce project — or, if you’re someone that would love to work for a company that not only uses open source but allows you to spend your working hours contributing back to open source, check out our openings in our career center!