Getting things

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

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

Since the very first time I started working with collections in Magento I run into situations where I needed to filter a collection by an attribute whose value is not set yet (for example, when the attribute is of the type ‘yes/no’, values 0/1). If I wanted to filter by all the products with a […]

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

During the past week I’ve dealed with a very weird and stressing thing with my colleagues: filtering a product collection by multiple categories in Magento. Filter by only 1 category Magento offers a type of filter that can be used directly from the collection: Filter by 2 or more categories This is a completely different […]

Read More

One of the last things I had to implement in Magento was a function to empty the customer cart. At first I found this great extension made by the Inchoo people, but it did much more than I needed. Having a controller to do this is fair enough, and the only code you need to […]

Read More

Some things are easy, some things are not. This one is easy-peasy. If you want to get the product list that a customer has been subscribed to (price or stock alert), you need to use the productalert model. Product stock alert list Product price alert list

Read More

The current project I’m working on has something special: each client has its own price, but this price is not in Magento but in an Oracle DB. Every client on the website has a client id related to the Oracle DB, and in the Oracle DB there is a discount that is different for each […]

Read More

One of the cool features in Magento Enterprise Edition is the reward points system. It’s very simple to configure and a really good way to make the customer feel «rewarded» for each action that he/she performs on the web. The reward points are shown by default in «My account» area and also in the checkout […]

Read More

I’ve been “suffering” out of memory problems on one of our clients magento installations. The version is the 1.4.0.1, and it seems that the queries are not as efficient as they are on Magento 1.5 and above. So I needed to find out what were exactly the SQL queries that produced that out of memory […]

Read More