Search AutoComplete and Suggestions extension for Magento

I just wanted to share this awesome [Free] Magento extension that modifies the quick search box by: Directly showing results (instead of related searches) Showing search suggestions Magento default quick search shows related searches as you type. From my point of view, this is not relevant at all. On the other hand, having results directly under the search box… that’s totally worth it.  Of course, you’ll need to apply some styles to the results box. Read more…

[Off-Magento] Solving the Warning: ssh2_scp_send(): Failure creating remote file: Invalid ACK response from remote error

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: $connection = ssh2_connect($host, $port); ssh2_scp_send($connection, $path_origin, $path_target, 0644); The connection was correctly placed, but when trying to copy the file, I got: Warning: ssh2_scp_send(): Failure creating remote file: Invalid ACK response from remote After looking for Read more…

Filter product collection by multiple categories in Magento

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: $_category = Mage::getModel(‘catalog/category’)->load($category_id); $collection->addCategoryFilter($_category); Filter by 2 or more categories This is a completely different story. It’s very important to proceed correctly in order to avoid errors of the type: [blockquote]Item Read more…

Best way of disabling the Region select for addresses in Magento

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 is the best and cleanest way for disabling this select box? From my point of view, this is the best Read more…

Magento EE 1.13 & EE 1.8

Magento EE 1.13 is finally out (last version was released in December. The focus of this version has been performance, especially regarding indexing. These are good news, as our experience with indexing problems and performance during the last months has been really bad. Magento CE 1.8 will follow soon, something completely necessary, as the last version was released in July 2012 (that means nearly 8 months without any updates, not even security updates) The most important Read more…

Programmatically set product position in a category in Magento

Today I had to reorder products in a category. Basically, our client wanted to put the products with special price at the end. After trying to do this with the category model in Magento, I finally run into the Category Api. It worked like a charm, even though it works kind of slow. Here you have the solution (with an example): $categories = Mage::getModel(‘catalog/category’)->getCollection(); $new_order = 300; foreach($categories as $category){ $cat_api = new Mage_Catalog_Model_Category_Api; $products Read more…

Passing arguments to a Magento Shell script

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 passing the argument title and argument value: php shellscript.php –argument_title argument_value Then, on the script code, you can retrieve this Read more…

Solving reindex issues with Product Flat Data in Magento

For the past 2 years we’ve run into a reindex issue when reindexing product flat data in Magento more than once. Basically, we wet something like: Product Flat Data index process unknown error: exception ‘PDOException’ with message ‘SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`DATABASE_NAME`.<result 2 when explaining filename ‘#sql-1803_1aa01′>, CONSTRAINT `FK_CAT_PRD_FLAT_2_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` ()’ in /app/magento_oneline/lib/Zend/Db/Statement/Pdo.php:228 Stack trace: #0 /app/magento_oneline/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array) Read more…

The most useful [active] Magento blogs

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 want to share them with you. Inchoo Best Magento blog ever. These people know what they do and explain it Read more…