M2M2: Attributes not showing

Published on 07 Aug 2019

If attributes don’t show up in the layered navigation and it isn’t due to the usual suspects, it’s probably a multiselect attribute. It probably got migrated as type text where it should be varchar. An easy SQL fix is this; See if this issue affects the website (you will get no records returned if you […]

Read more ...

M2: Media Query Hell

Published on 07 Jun 2019 , edited on 13 Jun 2019

Nothing is ever easy with Magento, and the same goes for the pretty much modern and straightforward CSS3 media queries. Because Magento is a smart system, and it has smart implementations for things. But it also has very poor documentation on these smart things. Which kind of makes them frustrating, dumb things. Magento 2 goes […]

Read more ...

How to add JS to M2

Published on 21 May 2019

Source To load a custom main.js file on all pages (in the RequireJS-way) this is a good way: 1) Create main.js Create main.js within the theme folder <theme_dir>/web/js/main.js with this content: In short: we declare dependencies at the start, e.g. “jquery”. We define as function’s parameter the variable name for using the dependency within the […]

Read more ...

The bane of M2

Published on 26 Apr 2019 , edited on 29 Apr 2019

This error, where the thing being undefined can differ is the error I run into most. I fixed it on some occasions, but the thing that does the trick seems to differ each time. This post is meant as a log to get to the bottom of what and why is happening here. Now this […]

Read more ...

M2: Fix Permissions

Published on 25 Apr 2019 , edited on 29 Apr 2019

Permission issues galore! Take these snippets, it’s dangerous out there!

Read more ...

M2M2: Product has weight issue

Published on 03 Apr 2019 , edited on 23 Apr 2019

So the migration succeeded (quite mysteriously I must add) and it looks like we have all data; Customers Orders Products Categories Attributes But there are some things missing, most notably there are no products shown on the frontend. Main lead on this is that there is a storeview missing which gives Fatal Erros in the […]

Read more ...

Ubuntu Desktop files and Dock

Published on 03 Apr 2019

After I did a clean install of Ubuntu 18.04 it came with Firefox reinstalled. But I also needed Firefox Developer to run along side it and I don’t remember exactly what happened, but something got screwed. My regular Firefox was installed as a ‘snap’ so it was running sandbox mode all the time (I guess? […]

Read more ...

M2M2: Migration

Published on 19 Mar 2019 , edited on 04 Apr 2019

Ah the migration. Oh the imports and exports. Woe is me. Countless hours spending crafting the biggest spreadsheets and CSV files. Error after error, so much frustration you eventually go beyond rock-bottom and reach a state of true nirvana. Let’s hope Magento’s Migration tool handles this for me this time around. What this tool does […]

Read more ...

M2M2: Installing certbot

Published on 15 Mar 2019 , edited on 22 Mar 2019

During setup and installation of the server for M2 I found that it wouldn’t run on an insecure IP address but it requires a FQDN with valid SSL certification. So I registered a .dev domain, because, well, why not. Just for full-disclosures sake, here’s the path for this; Registered domain Updated DNS to point to […]

Read more ...

M2M2: The server

Published on 15 Mar 2019 , edited on 22 Mar 2019

I was going to get my existing clean LEMP server install based on Ubuntu 14.04 LTS and update it. But I decided to get a clean slate and create a new image based on a clean Ubuntu 18.04 LTS version and start from scratch. What follows is more or less a direct copy of this […]

Read more ...

M2M2: The how-to

Published on 15 Mar 2019 , edited on 03 Apr 2019

We’re “Moving to Magento 2”. The “we” in this case is the company I work for and where I’m responsible for all things tech-related. Which, seeing as this business is an e-commerce business, is a big thing. We have been running about 20 Magento 1.9.x shops for a better part of two years now, but […]

Read more ...

Transfer files from GCP VM to another

Published on 03 Aug 2018 , edited on 22 Mar 2019

First, logon to the instance to move the files from and authenticate gcloud auth login Next run this command, on first try it will setup SSH keypairs and all gcloud compute scp file.ext [instancename]:/usr/share/nginx/html

Read more ...

Broke sound in Ubuntu 18.04

Published on 04 Jul 2018 , edited on 03 Apr 2019

Finding out my PulseAudio equalizer didn’t work after upgrading from 16.04 and trying to rectify that, killed my entire sound output. First, ran sudo apt-get remove –purge alsa-base pulseaudio sudo apt-get install alsa-base pulseaudio pavucontrol sudo alsa force-reload reboot Then sudo apt-get install pavucontrol pavucontrol But pavucontrol couldn’t connect to PulseAudio, something wrong with the […]

Read more ...

GCP: Resize persistent disk of running instance

Published on 27 Sep 2017 , edited on 22 Mar 2019

So we have a lot of instances running up and about and every now and then we find out we’re running out of diskspace due to excessive logging and/or poor optimization of added media files. And while it is always best practice to fix those issues and keep the environment as clean as possible, this […]

Read more ...

Adventures on GCP with mailservers

Published on 25 Sep 2017 , edited on 22 Mar 2019

I’ve been working on Google Cloud Compute Engine to set up servers for hosting all kinds of e-commerce related stuff. One of the more unknown areas to me here are the mailservers; they are complex in setup, very dependent on and specific to the environment they run on and even harder to debug if you […]

Read more ...

Github Gists broken again

Published on 21 Sep 2017 , edited on 22 Mar 2019

So I see that the Github Gists are broken again, when they load via AJAX. Soo, let’s go and fix it. https://bl.ocks.org/staeff/2b3ade0edcd3100f79c9 https://www.bennadel.com/blog/2312-loading-github-gists-after-the-page-content-has-loaded.htm

Read more ...

Ubuntu script for quick Gcloud Compute CLI access

Published on 21 Sep 2017 , edited on 03 Apr 2019

https://gist.github.com/ca9a77fe51e042562b46dffa2892d543 This lil’ function shortens the Gcloud Compute Engine SSH command to gc [instancename] and if no instance name is given, lists all instances.

Read more ...

FFS, running a Magento (1.x) subdirectory storeview on NGINX

Published on 25 Aug 2017 , edited on 22 Mar 2019

I’m writing this for all good and holy, as other Mage developers will recognize. Setting up NGINX configuration for a multistore installation can be a massive pain in the unpleasants. After another night of sighing, moaning and clicking through pages and pages of Google search results, I found something that works. Now obviously this is […]

Read more ...

Failing nginx tests

Published on 24 Aug 2017 , edited on 22 Mar 2019

So this is another weird one for me. While developing a Magento store on a self-setup LEMP stack I found out eventually that some parts of the system weren’t working correctly, and that no logs were being written. My first guess was that there was something wrong with the filepermissions, I think this has to […]

Read more ...

Magento 1.9: Add custom attribute to category

Published on 27 Feb 2017 , edited on 22 Mar 2019

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 […]

Read more ...

Install modman for Magento

Published on 23 Feb 2017 , edited on 22 Mar 2019

Install Modman from GIT bash <

Read more ...

Compute Engine LEMP Stack PHP7 for Magento 1.9

Published on 15 Feb 2017 , edited on 22 Mar 2019

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 […]

Read more ...

Magento 2: Product types and layout handles

Published on 10 Nov 2016 , edited on 22 Mar 2019

I find this something worth documenting, for the sheer scope of sources, obsolete code and articles and different semi-functional workarounds I’ve found about it. The issue? loading separate XML layout files for products in Magento 2. In my particular case all the products are Simple Products and yet I need to have different XML layouts […]

Read more ...

When the mouseclick dies in Ubuntu

Published on 07 Nov 2016 , edited on 03 Apr 2019

I knew that running Ubuntu as a primary OS (still on a MBP dualboot nonetheless) would be a challenge. I overcame many obstacles you’d never think about on another OS such as programming the touchpad manually, managing the memory management from scratch, installing much needed core elements and running into tons of bugs and issues […]

Read more ...

jQuery slideOpen from fixed to auto

Published on 17 Oct 2016 , edited on 22 Mar 2019

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 […]

Read more ...

QND: Style active page

Published on 13 Oct 2016 , edited on 22 Mar 2019

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.

Read more ...

WordPress check if child/parent

Published on 13 Oct 2016

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 […]

Read more ...

Magento2 – Edit mailforms & templates

Published on 11 Oct 2016 , edited on 22 Mar 2019

http://stackoverflow.com/questions/35123779/how-to-add-subject-in-tranctional-email-template-for-magento-2-version http://magento.stackexchange.com/questions/114214/magento-2-how-to-declare-a-custom-email-template-for-your-module

Read more ...

Goodbye Apple!

Published on 11 Sep 2016 , edited on 03 Apr 2019

(Yes, I’m afraid I have to get this off my chest too, being a long-term Apple user). It’s here, the pinnacle of our technological revolution. This is it, so it seems, it doesn’t get better then this. At least I think it doesn’t, because why would the largest tech company in the world start taking […]

Read more ...

Magento 2.1 – Adding custom attribute to category

Published on 15 Aug 2016

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 […]

Read more ...

Magento 2 Grunt not watching?

Published on 20 Jul 2016

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 […]

Read more ...

jQuery onClick fires twice

Published on 15 Jul 2016 , edited on 22 Mar 2019

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. […]

Read more ...

NGINX on VirtualBox; sendfile-Strangeness

Published on 05 Jul 2016 , edited on 22 Mar 2019

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 […]

Read more ...

Install Magento 2 via Composer on Apache server

Published on 23 Jun 2016 , edited on 22 Mar 2019

– Install SSH, GIT, NodeJS, Composer and Grunt on server – SSH to directory – composer create-project –repository-url=https://repo.magento.com/ magento/project-community-edition – Set rights – Run install command That’s about it. Now we have Magento 2.0.7 installed via Composer But I wanted to go up to 2.1rc3 for various reasons. To do this edit composer.json and find […]

Read more ...

Get Magento 2.1 running – the definitive guide

Published on 22 Jun 2016 , edited on 22 Mar 2019

The dust is starting to settle around the release of Magento 2 – the biggest open-source e-commerce packet available. Fate would have it that I’m getting more and more enrolled in the development of, with and applying this system for clients. So mainly for my own learnings this is a work-in-progress guide on all the […]

Read more ...

Note: Optimize Magento 2 for speed

Published on 14 Jun 2016 , edited on 22 Mar 2019

The main thing when ‘they’ developed Magento 2 was to improve on resource management and overall speed. Most people working with it, would scratch their heads in disbelief about it. Magento 2 can be painstakingly slow, but also rapid fast with the right configuration. It’s a known fact a Magento 2 developer needs to be […]

Read more ...

Note: Install Varnish on OS X

Published on 14 Jun 2016 , edited on 22 Mar 2019

– This article is a Note, which means it’s a work in progress or just a mental note to myself, mostly citing sources and recounting my steps in development – For a local Magento 2 installation I thought I’d try to install Varnish on OS X and found this guide to do so. It tells […]

Read more ...

Install Magento 2 via Composer on MAMP

Published on 09 Jun 2016

To install Magento 2 on MAMP takes a bit more effort than you’re regular WordPress installation. This is mostly because Magento 2 needs a newer MySQL and PHP version, and you’ll need your Terminal! 1. Install MAMP Download MAMP and install it. 2. Set correct PHP version Magento 2 will run on 5.6 and newer. […]

Read more ...

Magento 2 Snippets

Published on 02 Jun 2016 , edited on 18 Jun 2019

In it’s complexity I find one can lose a lot of time in just looking for the right mark-up for the right situation. That’s why I decided to make this little ‘scrap-book’ of snippets. Overwriting files Overwriting files in Magento 2 isn’t as straightforward as was with Magento 1. There you just had to have […]

Read more ...

Add non-category menu items to a Magento 2 shop

Published on 31 May 2016

In Magento 2 it seems to be difficult to add something to the menubar that isn’t a category, like a static page such as “About Us”. Well, I can tell you how to do it! There’s a quick and easy fix, and there’s a ‘good’ fix. Quick and dirty The quick and dirty fix would […]

Read more ...

Shell cheatsheet

Published on 20 Apr 2016

Working with SSH (Shell) commands can be extremely powerful and timesaving if you do it right. If you do it wrong, though, it can be disastrous. It also can be time consuming if you have to look up the right commands for each job all the time. That’s why I created this little cheatsheet, which […]

Read more ...

Development

Everything web development related, rants, snippets, tutorials, quests; it’s all there.

All categories

All tags

All posts