·

How to

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

Responsible Templating in Magento 2

Just because you can do anything in a template doesn’t mean you should. Some of you might already know the S.O.L.I.D way of programming. If you haven’t, it’s really interesting stuff if you want to be a better programmer. And besides that, the S.O.L.I.D principles can be found throughout Magento 2. The S in S.O.L.I.D read further ...

How to get the product price including and excluding tax in Magento 2

It seems like a simple task: get the price of a product in Magento including and/or excluding tax in Magento 2. I mean, how hard can it be? Well, to answer this question you must know that there are certain parameters in Magento 2 that determine the tax rate of a product: The configuration setting read further ...

Add a Custom Renderer to the Webapi of Magento 2

So I recently asked an interesting question on Magento Stack Exchange, because I was running in a problem: I was given the task to export a plain TXT list with SKU’s and a status of some sort. I wanted to be cool and learn something new so I decided to utilize Magentos’ web API functionality read further ...

How to get the categories linked to a product in Magento 2

This might seem like a no-brainer at first. I mean, come on! We all know we can just do $product->getCategoryIds() and move on from there right? You know, create a collection and stuff… But beware! This is not ‘The Magento Way’ on how to do this. I’ve recently posted an interesting question on Stack Exchange, read further ...

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

1 2 3 10