You probably know the famous $product->load($product->getId()) that populates your product object with data retrieved from database. This method does not use native Magento caching while it could be useful to avoid numbers of repetitive MySQL queries. Here is a short example showing you how to cache Magento product loading.
Archive for category ‘Magento’
Little code snippet that retrieves the quote total excluding tax for current customer, it will make you maybe win the next half hour I lost figuring out how to make.
Sometimes you absolutely want your module to be installed after the default ones defined in Magento. You have propably tried to play with the dependencies between modules, but this has no impact on the prioritization of modules. Here is a little code snippet to keep Magento default installation and to install your module afterwards.
We have already seen in a previous post how to override a controller into Magento. This time I’ll show you how to create your own controller in admin panel in an efficiant way, because there are many solutions here and there but they do not always work and are sometimes obsolete. We will access our […]
With Magento, the stock of a product is not stored each time it’s changing. However, the stock may be modified in many ways (product ordered, canceled order, manual changes, imports, etc..) and it may be useful to know how and when the stock has changed. Here is a simple extension that saves over time the […]
When developing Magento modules, it is quite tedious to create packages for Magento Connect. That is why there are often modules that are not present in this one but available elsewhere, eg on GitHub. I will present here a very fast way to install Magento modules available on Git repositories through modgit tool.
In a Magento project, we have sometimes the desire to associate an image with attributes options of our products. This can be useful in the layered navigation to highlight a list of colors rather than text alone, or associate a logo with the brand of a product and display it in the product view. I […]
Caching data in Magento can have a significant impact on the performance of your site. Here’s how a few lines of code you can easily cache any data type.
Here is a sample code showing how to easily add your own configuration settings in Magento.
Another simple trick. This time we will see how to disable a default event observer. This can be useful if you want to prevent a method to be executed when Mage::dispatchEvent() is called, or simply if you want to define the behavior you want by writing your own observer.