Magento 1.9: Add custom attribute to category

Step 1. Init module app/etc/modules/AT_CustomCatAttr.xml Step 2. Create config app/code/local/AT/CustomCatAttr/etc/config.xml Step 3. Create SQL script app/code/local/AT/CustomCatAttr/sql/add_category_attribute/mysql4-install-0.0.1.php Make sure the filename and path match the version (0.0.1) and nodenames (add_category_attribute) of the config.xml from Step 2. Optional If you change anything in the module, you can update it with a new version number. In this case […]

Install modman for Magento

Install Modman from GIT bash <

Compute Engine LEMP Stack PHP7 for Magento 1.9

So I was tasked to set up a LEMP Stack with PHP7 on a Google Compute Engine and to install a new Magento 1.9 install on it, for further development of things. This is my story (that is to say this isn’t as much a tutorial as it is just a notebook of the things […]

jQuery slideOpen from fixed to auto

I came across this little problem trying to do something that seems obvious; animate a div sliding open from a fixed height in pixels to a full auto height. Apparently this is something jQuery can’t do out of the box, at least not without some help. It uses a DOM node known as scrollHeight. In […]

QND: Style active page

Sometimes you just need something quick’n’dirty, like this time I had to add an active class to totally unrelated items on a page, based on the page title.

WordPress check if child/parent

I recently came across a situation where I needed to show a sidebar on a page template, if the page has childeren. Consequently I also had to check if the current page was such a child, and if so show the same listing from the parent (which are ‘sibling’ pages at this point). To do […]

Magento 2.1 – Adding custom attribute to category

In Magento it’s pretty easy to create custom attributes for products, but it’s less so for categories. As with many things in Magento2, the general best practice is to create a custom module for it. Note: This guide is for version 2.1 and up, because since 2.1 a lot of the infrastructure regarding this functionality […]

Magento 2 Grunt not watching?

The best way to make your Magento 2 frontend-development workflow wórk as a flow, is to use the included Grunt config. Now that’s quite a pain to set up but I found this article made it possible. But what if you’ve set this all up, and for some reason Grunt stops watching your files? Here’s […]

jQuery onClick fires twice

While doing some extensive JavaScript and jQuery work, I came across a testing console.log that kept firing twice. The most obvious reason would be that the script was rendered or included twice in the body, but it wasn’t. It was something more deserving of a facepalm. The element of the click function was a label. […]

NGINX on VirtualBox; sendfile-Strangeness

Running Vagrant in VirtualBox is a great way to make a local dev setup for any webdeveloper. Except for when you encounter the strangeness of the sendfile-bug in this combination which has been here for over 8 years now (!). What happens is this; you create (say) a style.css and fill it with your complete […]