·

How to

Tips & tricks, tricks & tips. Looking for a way to achieve something? Here’s how to do it!

How to properly calculate FPT/WEEE on configurable products in Magento 2

Recently I stumbled on another nice ‘feature’ of Magento 2. When applying Fixed Product Taxes (FPT) in Magento 2, the functionality seemed a bit … broken. I was trying to apply different FPT’s on the simple children of a configurable product. A client of ours sells refrigerators and their models come in various sizes. We’ve read further ...

Quickly run scripts in the shell in Magento 2

Magento 2 has a great functionality for running scripts in the command line, but sometimes you just want to quickly check something without creating a new CLI command or creating a unit test. Wouldn’t it be great if you could just write a PHP script and write some simple code in it, just to speed read further ...

Unit Test your custom module in Magento 2

Magento 2 comes with a great set of unit tests out-of-the-box. You can add these tests to your module as described by Ash Smith in this article, but that means you need to run your unit test with the –filter  attribute like so: This is great of course, but it still means the entire test read further ...

Magento 2 : Use custom source models for multiselect product attributes

Source models in Magento 2 are very simple. They simply are classes that return a list of properties. A very basic example: You can use this source model in configuration files or in the source_model-column of your EAV attribute. But … When you want to use multiselect instead of select, you might encounter the read further ...

Magento 2 : Add a product attribute to all attribute sets programmatically

When a Magento 2 shops grows, it gains more and more attribute sets. Adding new attributes to all attribute sets might become a cumbersome task. Especially when you first have to do it on your local development environment, and once again for your test- and production environments. Seems not very DRY to me. So why read further ...

Utilising Magento 2’s CLI Possibilities

Some of you might already know this, but I’m a great fan of the command line. In web development, I use PHP to write CLI scripts more than often. They provide a great way if you need to perform quick tasks on the server, or if you want to perform tasks after a deployment. If read further ...

How to add a custom renderer to the admin grid in Magento 2

So you want to add a custom render to the admin grid in Magento 2 huh? Well, today I was faced with just that same task: One parameter of my custom model was a reference to the manufacturer ID. So the manufacturer ID is stored in the database, but in my grid I wanted to read further ...

Creating Widgets in Magento 2

One feature of Magento that is not as often used as it should be are widgets. Widgets are configurable blocks that can be added to the content in wysiwyg editors in the admin. This gives us great possibilities to add rich content with the wysiwyg-editor without having to manually edit the HTML code. Because having your client read further ...

Creating Blocks in Magento 2

Just like Magento 1, Magento 2 has blocks. For those who don’t know what Magento blocks are: they are classes that template (parts) can use to gain some specific functionality. Blocks are used throughout Magento and are a core part of it’s design and will most likely also be a part of your customisations. So read further ...

1 2 3 4 10