·

How to

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

Can’t remove images from the admin in Magento?

Today I stumbled upon an issue in Magento which I couldn’t wrap my head around: In the backend I checked an image to be removed from the media gallery, but upon saving, nothing happened. Magento didn’t show a message and my logs were empty. After a while of looking what was going wrong, I finally read further ...

How to parse XPath in NodeJS

Need to parse an XML Document in NodeJS using XPath? Here’s how: Such a tiny little snippet…read further ...

How to enable autocompletion for NodeJS in PhpStorm

Recently I’ve been tinkering a bit more with NodeJS, just to expand my horizon. I’ve done some simple things with NodeJS before, but since I work for 99% with PHP (WordPress, Magento) I (still) haven’t got a real use case yet to implement it on a larger scale. Nevertheless – curious as I am – I started tinkering a read further ...

How to add custom properties to magento attributes

A while ago I wrote an answer on stack overflow regarding the question “How to add custom property to Magento attributes and display it on the front end”. The question was simple: I would like to add a text description on the properties’ tab and display it on the front end. I happened to have read further ...

Save an EAV attribute in Magento without touching the model

If you have a batch operation for thousands of products, categories, customers or any other Magento entity that uses Magentos’ EAV-structure, speed and memory usage are important factors to consider. Especially when you only need to change one or two attributes of a product or category there’s no point in loading the entire model for read further ...

Migrate MySQL databases with stored procedures

Ever tried to migrate a MySQL database with stored procedures or views? Ever ran into the error “The user specified as a definer does not exist”, or “Access denied; you need (at least one of) the SUPER privilege(s) for this operation”? Chances are that you are trying to migrate a MySQL database with stored procedures or views. read further ...

Get Magento category URL without loading category

If you want to get the URL of Magento without actually loading the model, you can use Magento’s core URL rewrite functionality to fetch the URL without all too much load on the database like this: I had to use this nifty trick once when I had to load a category tree that consisted read further ...

How to add complex joins to your collection in Magento

I recently had the situation where I had to add a really complex field to a product collection in Magento. The client had a very special way of calculating product prices that depended on: The supplier that delivered the product the cheapest (a product could have more than one supplier). The customer that was logged read further ...

Make better use of Magento’s cache

Magento has it’s built-in caching mechanism, but unfortunately it’s not used very often (or by default). This is good to know when you are creating a module with your own custom block templates. When you know what you are doing, the speed benefits can be pretty impressive!read further ...

1 6 7 8 9 10