·

magento 2

Import images in Magento 2 – the right way

There are various articles about how to programmatically import images in Magento 2. This method relies solely on service contracts and is in my opinion the “Magento Way” to do it: Note that we don’t copy our image whatsoever, but make use of an ImageContent object. This is a new layer of abstraction in read further ...

Convert an order to a shipment in Magento 2

I’ve recently found a small article on how to convert an order to a shipment in Magento 2, but the code in question was a bit outdated. For example, it leaned heavily on the Object Manager instead of handling it with dependency injection and repositories. For that reason, I rewrote the code a bit to read further ...

Create URL Rewrites in Magento 2

Here’s a quick draft on how to create URL Rewrites in Magento 2: read further ...

How to style the checkout/onepage/success page in Magento 2

It’s a common problem: you want to style, template or test the order success page, but each time you refresh the page Magento 2 redirects you to the cart page. This is the default behaviour of Magento 1 & 2: when you’re order is complete, you’re only allowed to see this page once. Refreshing the read further ...

Adding custom category attributes to Magento 2.1

Magento 2.1 was released several days ago, and oh boy … Much has changed! I mean, just look at the release notes! If you’re already working with Magento 2 and you’ve added some custom attributes to your categories, you might have noticed that your tab with options is no longer there. Simply because all tabs aren’t read further ...

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 ...

1 2 3 4