Convert EPS files to SVG graphics using PHP and Inkscape

Recently I had the job to convert EPS files to SVG graphics. It has been done for a product configurator that had to be implemented. The whole implementation mentioned here was done for a Magento Online Shop. But the base-paradigms described here can be used in other PHP based applications too because I’ve implemented them […]

Magento: change applied attribute product types

Sometimes it is necessary to change the product type(s) an attribute is applied to in Magento. A common example is, that you designed and implemented an attribute for a configurable product, because you thought its real world value is equal over all child manifestations. But after a while you realize, that there are differences that you […]

Magento “Invalid website id requested.” error in backend on product save

Today I got a error in the Magento  backend telling me, that I have requested an invalid website_id (Invalid website id requested.), when I tried to save a product. The problem was, that I had deleted unused websites and stores over the Magento backend. Unfortunately Magento seemed to keep the relation between website and product, although […]

Run multiple Magerun instances at once

In the past I already wrote articles about the very genius tool Magerun from Netz98, that I nearly use on every Magento project. Recently I had the challenge to run three instances of Magerun on the same physical server with only one shell account. This was necessary because I ordered a big cluster from maxcluster for […]

Magento change attribute scope in setup script

This code snippet shows how to change attribute scope in a setup script: <?php /* @var $oInstaller Mage_Catalog_Model_Resource_Setup */ $oInstaller = $this; $oInstaller->startSetup(); $oInstaller->updateAttribute( ‘catalog_product’, ‘abc_attribute’, ‘is_global’, Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE ); $oInstaller->updateAttribute( ‘catalog_product’, ‘xyz_attribute’, ‘is_global’, Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE ); $oInstaller->endSetup(); // mark index as “reindex required” $aIndexerCodes = [ ‘catalog_product_attribute’, ‘catalog_product_flat’, ‘catalogsearch_fulltext’ ]; $oIndexer = Mage::getModel(‘index/process’); foreach ($aIndexerCodes as $sCode) […]

Remove empty rows from CSV

Recently I had to remove empty rows from a Magento ImportExport product export CSV file (see https://www.webguys.de/magento-1/turchen-19-produktimport-mit-der-importexport-schnittstelle). The format of these files is really complex. The problem was, that I did a cleanup of the product data inside the file. As a result of this there where empty rows. So I had to eliminate them. […]

MySQL server has gone away error fix for Magento

Today I wanted to test a tiny shell script, that didn’t do such magic stuff. It only generates a few websites, stores and storeviews and associates approximately 200 products to 4 websites. When I ran it locally I had no problems at all. But on the staging server I got the following error message when […]

Associate products to all websites more performant

Recently I had to associate all products of a shop to newly created websites in a setup shell script (Associate products to all websites). This could have been implemented like that: <?php /** * Associates products to the newly created websites */ private function _associateProducts() { $aWebsiteIDs = Mage::getModel(‘core/website’) ->getResourceCollection() ->getAllIds(); //remove default website array_shift($aWebsiteIDs); // […]