Development

There are a lot of articles on Internet proposing the deletion of all categories using a sql query. I’ve tested one of them and I’ve run into several problems due to this (url keys not deleted correctly, deletion of the Default category…). There is a safer way, using Magento tools. Things you need to know: […]

Read More

When calling the function $block->getProduct() in a quote item in the cart page, Magento 2 will return the product and its basic attributes. The attributes that can be retrieved from the product when calling this function in a quote_item page can be found in the file vendor/magento/module-sales/etc/catalog_attributes.xml. From your own module, you can create the […]

Read More

It’s pretty easy when you have the eavSetup in your setup module. It’s only necessary to execute: For example, if I want to change the ‘position’ field value of the ‘price’ product attribute:

Read More

It might be tricky if you want to create a multiselect product attribute in Magento 2. For that, it’s necessary to pass the correct backend model: if you don’t do it your attribute will be created but the values won’t be saved. Taking this Inchoo article as a basis, you just need to know the […]

Read More

[Edited] I’ve updated the article to do this in a better way Recently I had to do something I thought it was simple to do: add the category images to the navigation menu. However, Magento doesn’t use a template to draw the whole menu but a function that will retrieve all categories and generate the […]

Read More

Getting the “current product” in Magento 2 is trickier than it was in Magento 1. However, it is like that for a reason: Mage:: is a thing from the past, no more accessing to everything from everywhere (someone I know would say: “this is not logic at all”). That’s the reason why, in order to […]

Read More

Recently I wanted to remove a field from a form object. It was easy, we need to know 2 things: Fieldset name (‘main’ by default) Field name With this information we can just update the form object with:     <?php $this->getForm()->removeField(‘password_fieldset’); ?>

Read More

I have recently run into this Magento script who lists all the cronjobs on the site (coming from core, community or local). Easy to use and with a good result view!

Read More

At my company we’ve been using tools like Munin to monitor the server. Munin is a great tool that shows all type of graphs of what’s going on in the server: Apache processes, Varnish memory, Database performance, Server load, Disk usage, Memcache performance… and a lot more. Basically, you can configure any service you have […]

Read More

The «Class “Mage” not found» issue has been recently a headache in most of our projects. I could say that there was a specific change eventually (either a package update, package installation, configuration change…) that make this error appear. The problem is not the error itself, the problem is that this error is not providing […]

Read More