Posts

Magento2 - Benchmark fixtures

October 9, 2021

Introduction # With release of Magento2 - developers got a nice tool called - Performance Toolkit. Its purpose is defined clearly: The Performance Toolkit enables you to test the performance of your Magento installations and the impact of your customizations. It allows you to generate sample data for testing performance and to run Apache JMeter scenarios, which imitate users activity. However, Magento developers use just fraction of it’s possibilities - that is - creation of fake data. ...

Postman - WSSE authorization header

January 21, 2021

Introduction # Some services’ API require authorization based on WSSE header. That means, that server expects X-WSSE header to contain string including username, encoded password, nonce and timestamp - where timestamp is also used as salt. So - since timestamp is involved in it - every request will require different value for this header - it must be calculated on the fly - in the moment when request is made. ...

Magento2 - Configuration values scope hints

January 2, 2021

Magento2 Config Scopehint extension # One of the most important things to understand in Magento is concept of scope! Website - Store - Storeview. For many developers it becomes pretty natural after a while - inheritance of values, global scope, website scope - difference between website and store and so on. While for us it’s easy (after a while) to understand, it might become confusing for merchants or less experienced store managers. ...

Magento2 - Newsletter API

December 28, 2020

Introduction # In this post - I try to share some nice tips about Postman and how it can be used for TDD of Magento API extension. By default, native Magento Newsletter module doesn’t provide any way to manage or get newsletter subscribers. Luckily, it’s not that big problem, because we can create such endpoints on our own. Magento2 is super friendly when it comes to create new endpoints and most of the job is already done - what we need to do is just to provide logic for them. ...

Magento2 - My first MFTF Test

June 20, 2020

Introduction # As Magento developer, you quickly realise that keeping high quality of your work in such complex architecture is both challenging and required at the same time. When your code is buggy, it can affect different aspects of the system. Also, how can you be sure that you are not breaking part that you’re not even aware of? Magento introduced MFTF framework some time already, and when I wanted to use it, I’ve encountered some issues and support for these issues are somehow limited. ...

Magento2 - Admin cache refresh helper

June 14, 2020

Admin cache message refresh helper # I have prepared really simple extension for Magento that can save few minutes every week. Whenever you make change in admin panel, Magento tells you that you need to refresh one or more cache types. So you follow the link, select cache types and hit Submit button. With this extension you can do all these directly within the popup. You have options to refresh all cache types or just those marked as invalidated. ...

Magento2 - Conditional layout directives

June 14, 2020

Introduction # I consider Magento’s template engine, based on XMLs, .phtmls - as the best one on the world. Sure, entrance barrier is high, especially for frontend developers, but as soon as one learns how to use it properly - whole new world is open. With XMLs approach - templating engine is highly customizable and flexible. Layouts can be extended and altered by 3rd party code. Sometimes - we need to include block (or exclude), based on some conditions. ...

Magento2 - Shared increment-id for multi-websites setup

June 14, 2020

Introduction # By default Magento2 have different incrementIds for EAV entities for each store - for example for orders’ incrementId: New order Storeview A Storeview B Placed in A #1000000 Placed in A #1000001 Placed in B #1000000 Placed in A #1000002 Placed in B #1000001 However, in some cases you might to have this scenario represented this way: ...

Magento2 configuration tweaks

June 14, 2020

Introduction # Magento2 (as well as Magento 1) implements really good interface to handle configurations for 3rd party modules. Developers are able to create rich and informative configuration panels. However, sometimes it feels like extensions use only basic features provided by Magento. No surprise, some of them are hidden or not documented well enough. This article tries to put some lights on not-so-well-known features that you can use to make your confiiguration panel better. ...