Development

Recently I had to use ssh2 through php in order to send files from one server to another. I don’t know why, I was getting a error that was not actually very common on the Internet. My code was: The connection was correctly placed, but when trying to copy the file, I got: Warning: ssh2_scp_send(): […]

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

Region select is not perfect in Magento. For example, for UK, there are missing counties, probably due how official they are or maybe just because Magento didn’t take the correct database. One way or another, region field is not considered one of the required fields for most sellers when integrating orders on their ERP. What […]

Read More

Using Magento Api to create shell scripts seems to be easy, but there are too many things to take into account to get the most of it. In this case, I want to explain how to pass an argument from the command line when executing a magento shell script. You have to call the script […]

Read More

Ever since I started programming in Magento/PHP, I had the need to find Magento blogs with useful tips and up-to-date information (Magento changes very quickly along with how things have to be done with it as well). After almost two years I’ve only found a few blogs that are up to date and useful. I […]

Read More

Usually I’ve been asked about how to run a cron task manually. A cron task defined in Magento is not anything else than a function that belongs to a model that is loaded and executed. For example, we have this cron task on a config.xml file of a specific module: It’s easy to identify the […]

Read More

During the past days we have had some problems when updating our Magento custom modules. Oddly, even though we created the mysql4-upgrade file and edited the config.xml with the new version, the upgrade script wouldn’t run. Why? We don’t know. But we needed a quick solution because there was an important issue in the production […]

Read More

By default, Magento shows the store that has been configured «by default». Adding browser language auto-detection is pretty easy editing the Magento index.php file. We just need to check what’s the user browser main language and then try to load the store that uses that code. It’s important to note that maybe the user has […]

Read More

A few days ago we tried to install and set Solr as a Magento default search system. We run into a weird problem: once we checked that Solr was working we enabled it in Magento. Everything seemed to work well: when reindexing products the log would show the changes and the button for testing whether […]

Read More

If you want to programmatically update product prices per website (this means that you have many websites and have set a website scope for price in the configuration), then you can use this script: Important note: I haven’t developed this, but I think it’s interesting to note it down. Thanks to Knowledge Craving from Stackoverflow.

Read More