Override classes and constructor arguments

As for Magento 1 it is possible to override classes in Magento 2 as well. Don’t get me wrong. It is not recommended to override classes or methods. It should be the really last resort. Use a plugin or an observer whenever possible. But sometimes the code you’re working against isn’t suitable for one of […]

Find and reference standard attribute types in Akeneo code

All standard attribute types available in Akeneo are listed in “\Akeneo\Pim\Structure\Component\AttributeTypes” (File: src/Akeneo/Pim/Structure/Component/AttributeTypes.php).

In you own code you could (and should) reference these types instead of using strings.  For example lets say you want to delete attributes by an array of attribute codes but you want to skip identifier attributes from deletion.

Desktop FloppyDisk Pen Holder

New Thing on Thingiverse Recently I realised, that my girlfriend had some FloppyDisk left and wanted to throw them into trash! :-O Hence these awesome relics of computer history reminded me of my childhood and youth, I decided to build something new out of them. To be creative so to say! ūüėÄ As a result […]

Create a bcrypt hash on commandline

Its easy to create a bcrypt hash  on commandline with this command:

Just replace the Placeholder USER and PASSWORD with the corresponding values. The Result should be something like that:

The part before “:” is the username. The rest is the bcrypt password hash. The -C parameter specifies the computing time for the […]

Resize product images in Magento2

To resize product images in Magento2,  you just have to add a etc/view.xml into your own theme (f.e. app/design/frontend/Sheldon/Happytheme/etc/view.xml) ans add something like that:

As you can see, you can adapt the image dimensions for each image type available. That works also for self installed image types. The values for width and height are […]

Get a filename only list of files in a folder

To get a list of all files in a folder without path, you can use the following snippet:

Example result:

Prefix files: If you want to prefix files, you can use the same command too:

Example result: