Save typing effort for complex MySQL queries with custom variables or procedures

To save time and because it’s not that smart to repeatedly retype the same things multiple times, you can user custom variables in MySQL like that: SET @store := 1, @name_id := 71, @short_desc_id := 72, @desc_id := 73; SELECT CPE.sku AS sku, CPEVN.value AS name, CPEVSD.value AS short_description, CPEVD.value AS description FROM catalog_product_entity AS […]

Disable touchpad under Ubuntu

This little tutorial shows, how to disable touchpad under Ubuntu (v. 16.04) permanently. The reason is, that I generally use only the red trackpoint of my Lenovo T530 as a pointing device. I don’t need a touchpad anyway. But when working with the trackpoint, I accidentally touch the touchpad with my thumbs many times. That […]

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. […]

Download File via SCP in Ruby

To download a file vie SCP under Ruby, you can just use the NET::SCP class included in ruby like that: require “net/scp” =begin Downloads a single file or a folder via scp Parameters: – +host:: +string+ remote IP or domain to get the file / folder from – +ort+:: +string+ remote port – +use+r:: +string+ remote user […]

Plesk – regain access to the admin panel via shell

Today I had to regain access to the admin panel of one of my root servers that uses Plesk as administrative panel. I had configured a IP restriction for the panel under Tools and Settings > Restrict Administrative Access. The problem was, that I wanted to access the machine from outside of the company network (my […]

Add product attribute columns to Woocommerce backend grid

If you have to extend the backend product grid of Woocommerce by an custom attribute , you have to follow the steps below to add product attribute columns to Woocommerce backend grid: Register and sort  the new columns via a filter hook (‘manage_edit-product_columns’): <?php add_filter( ‘manage_edit-product_columns’, ‘add_columns_to_product_grid’, 10, 1 ); const BACKEND_PRODUCT_GRID_FIELD_SORTORDER = [ ‘cb’, ‘thumb’, ‘name’, […]