What's New in Magento 2.4.7

Magento 2.4.7 adds Apple Pay, Google Pay, and Venmo to Payment Services, plus a new GraphQL server that cuts latency by roughly 30%. Adobe Commerce gets multiple coupons per order, support for up to one million coupon rules, and official PHP 8.3 support.
Chapters
If you're anything like me, whenever a new version of Magento is released, you're probably wondering what new features are as well. Well, let me save you the hassle. In this video, we'll cover all of the new main features of Magento247 and skip over anything that is either boring or that you don't need to know about. And if you're a developer, hang on to the last one because it's a big one. Are you ready? Let's do this A great way to improve checkout conversion is by providing potential customers with with as many payment options as possible. This allows them to choose a provider which they are comfortable and familiar with. Magenta247 includes some support for additional payment methods out of the box, including Apple Pay, Google Pay, Venmo, and pay later with PayPal. This is provided by the Payment Services feature, which is available in both Magento Open Source and Adobe Commerce. Each payment option can also show up in different areas depending on where you are in the checkout process. This includes the product page, Mini cart, shopping cart, and checkout views. One thing that I love about Magento is the ability to support any payment provider or option that you want. You aren't limited to a specific subset of payment options and aren't restricted from using a specific payment method in your store as you are with some SaaS solutions like Shopify and don't need to use any construed payment checkout workflows. If you want to use payment methods or which conflict with the interest of the aforementioned SaaS provider's interests. You can also fully customize the checkout however you wish, and there are courses available out there which can help you do just this. While not specific to Magento247, did you know that you can provide your customers the option to save their credit card information to your store? This allows them to easily use it in another future purchase even if it's in another store if it uses the same merchant account. This is called credit card vaulting and and uses the concept of secure tokens, which is completely secure and PCI compliant. Magento's implementation of this requires the use of a payment method that supports a secure vault such as Braintree or PayPal Payments Pro. When a secure vault is enabled, customers have the option to save their credit card in the checkout and can also manage stored payment methods from their account dashboard. Again, this credit card vaulting implementation is completely secure. Customers will only see the minimal amount of info that they need to, including the last four digits of their card number, the expiration date and the type of credit card that it is. All other related credit card data is stored externally at the payment provider in a digital vault. Magento is only aware of the corresponding token that is related to the credit card when a customer checks out. That token is then used, which can only be deciphered from the vaulting service. If you Happen to use GraphQL, which you do. If you run Magento in any headless or PWA based architecture, you'll like the updates coming to GraphQL. The new application server for GraphQL was created to improve the efficiency and responsiveness of calls to the GraphQL API layer. This new layer allows you to sustain the state between GraphQL API requests. This can reduce the time of requests and responses by as much as 30%. This new application server runs on a PHP extension called Swool. SWOOL is a high performance framework that is best used for event driven asynchronous non blocking requests which aligns perfectly with Magento's GraphQL layer. It was installed inspired by Golang and allows you to run and write coroutines. Swool allows you to run functions concurrently or at the same time by simply using its Go function. As you can see here, there are two functions with sleep statements and when they are processed normally it takes about three seconds to run since the first function sleeps for one second and the second sleeps for two. If we simply enable coroutines and wrap these functions within Go function calls, we can see that the result takes two seconds rather than three. This is because the functions are not executed in parallel but concurrently. This works in much the same way as you tapping the like button as watching this video, but this has greater IO benefits when applied to something like a GraphQL layer, which can make API requests significantly more efficient. While there are other improvements to the GraphQL layer in Magento 2, 4, 7 including enhanced caching and support for custom attributes and canceling orders. The application server is specific to Adobe Commerce. The good news is that if if you do run Adobe Commerce, you'll have the Support of the GraphQL application server through Commerce Cloud and can configure it right from the Magento app YAML file. If you run Adobe Commerce on Prem, you'll need to install the swool extension with PECL and then run some additional steps to confirm that you can connect Commerce to the application server. If you aren't yet familiar with GraphQL, check out my course the Art of GraphQL in Magento 2. This will teach you everything you need to know to use it within Magento, even if you currently know nothing about GraphQL while we're on Adobe Commerce, let's talk about a few more updates which help separate it a bit more from the open source version. There are some minor updates such as the ability to accept multiple coupons on a single order, the ability to configure up to a million active coupon based CART price rules, and JSON support for the REST Import API which can process 100,000 records a minute in JSON format. The commerce webhooks functionality just got a big upgrade. The update to webhooks allows developers to configure synchronous logic to execute calls to external systems whenever it is triggered by an Adobe Commerce event. Synchronous calls are required when Commerce needs to immediately execute or carry out some task and then return the result back to Commerce or the user based on the result of that call. Now, I don't think synchronous calls are a good default. It's much better to run code like this asynchronously so the request can execute faster and the user isn't sitting around waiting for a response. However, there could be specific scenarios where this could be really useful, such as confirming with an external system that a specific product is in stock before the order is placed. Well, this is now possible, along with a few extra commands related to webhooks when running the Bin Magento CLI command. See the link in the description for more info about how Adobe Commerce webhooks work and how they can be configured. An obvious big takeaway for Magento developers with this new version is Support for PHP 8.3. The new version of PHP was released in November of 2023 and it's now April 2024. This means that official Magento support for a new PHP version was dropped in less than 6 months. This is the fastest turnaround time that I've ever seen Magento do and ra waiting years to be able to use the new features of the language as we have in the past. We can now start using them today. There are a few notable features in PHP 8.3. The one that will probably be most widely used is the new Override attribute. When PHP8 was released, it released support for attributes, which provide the ability to add structured metadata to many parts of php, like classes, functions, properties, and so on. This is done with a comment created with a hashtag in brackets. Attributes essentially allow you to add additional markers or configuration to your code taking this new override attribute as an example. This helps us developers know if we are overriding a method from parent class. If the parent method's name ever changes, the compiler can throw an error which lets us know that our code may no longer work as expected, which could potentially catch a bug before it's released to production within E commerce. This can prevent some huge headaches from occurring. Other notable updates in PHP 8.3 include typed class constants, deep cloning of read only objects, and a new JSON validate function which makes sure JSON objects are valid and does so with using much less memory. I really hope that Magento releases support for new PHP versions like this in the future. Developers Having access to the latest and greatest really increases developer happiness and it keeps on empowering the ecosystem to continue moving forward. And if you are a Magento developer and really want to improve your developer happiness, check out this video about Beeline, a tool that I developed which can help you write Magento code really quickly and according to all of the best practices and coding guidelines of the framework. Thanks a bunch. And until next time, keep coding.










