Skip to content

Instantly share code, notes, and snippets.

View borriglione's full-sized avatar

André Herrn borriglione

View GitHub Profile
@borriglione
borriglione / gist:2237588
Created March 29, 2012 13:45 — forked from quafzi/gist:2234563
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@borriglione
borriglione / mage_dump_products_and_categories.sql
Created April 6, 2012 13:17
Magento Product and Category Related Tables
mysqldump -u dbuser -p dbname cataloginventory_stock_item cataloginventory_stock_status cataloginventory_stock_status_idx catalogsearch_fulltext catalogsearch_query catalogsearch_result catalog_category_entity catalog_category_entity_datetime catalog_category_entity_decimal catalog_category_entity_int catalog_category_entity_text catalog_category_entity_varchar catalog_category_flat_store_1 catalog_category_flat_store_2 catalog_category_product catalog_category_product_index catalog_eav_attribute catalog_product_bundle_option catalog_product_bundle_option_value catalog_product_bundle_selection catalog_product_entity catalog_product_entity_datetime catalog_product_entity_decimal catalog_product_entity_gallery catalog_product_entity_int catalog_product_entity_media_gallery catalog_product_entity_media_gallery_value catalog_product_entity_text catalog_product_entity_tier_price catalog_product_entity_varchar catalog_product_flat_1 catalog_product_flat_2 catalog_product_index_eav catalog_product_index_eav_idx cata
@borriglione
borriglione / gist:6452305
Created September 5, 2013 16:09
Hotfix - Multistore Redirect Payment Methods
diff --git a/app/code/community/Netresearch/OPS/controllers/ApiController.php b/app/code/community/Netresearch/OPS/controllers/ApiController.php
index 61f5154..e14f995 100644
--- a/app/code/community/Netresearch/OPS/controllers/ApiController.php
+++ b/app/code/community/Netresearch/OPS/controllers/ApiController.php
@@ -32,6 +32,24 @@ class Netresearch_OPS_ApiController extends Netresearch_OPS_Controller_Abstract
public function postBackAction()
{
$params = $this->getRequest()->getParams();
+ /**
+ * Hotfix
@borriglione
borriglione / gist:318f094bcba7b25a5938
Created February 3, 2015 09:13
Magento Database - Duplicate key checks
Duplicate Checks
================
http://www.albertomariarossi.it/howto-solve-url-rewrite-indexing-errors-in-magento/
1- Check for duplicate SKUs
---------------------------
SELECT
DISTINCT(`sku`) as `sku`,
COUNT(`sku`) as `skuCount`, `entity_id` FROM `catalog_product_entity`
<?xml version="1.0" encoding="UTF-8"?>
<result>
<grp id="G1">
<fld name="YBPCNUM" type="Char">PO109009</fld>
<fld name="YITMREF" type="Char">PV00068203</fld>
<fld name="YSAU" type="Char">UN</fld>
<fld name="YQTY" type="Decimal">6</fld>
<fld name="YDAT" type="Date">20161110</fld>
<fld name="YPRITYP" type="Integer">1</fld>
<fld name="YFCYVEN" type="Char">TOL</fld>
@borriglione
borriglione / gist:5c00aedd02d1f7414159e37601b6d5ba
Created September 11, 2017 14:26
app/code/local/Rom/OgoneFieldLimit/etc/config.xml
<global>
<helpers>
<romogonefieldlimit>
<class>Rom_Phyderma_Block</class>
</romogonefieldlimit>
<ops>
<rewrite>
<payment_request>Rom_OgoneFieldLimit_Helper_Payment_Request</payment_request>
</rewrite>
</ops>
@borriglione
borriglione / README.md
Last active May 9, 2018 10:32 — forked from aboritskiy/README.md
Magento 1 attribute usage statistic

Magento 1 attribute usage statistic

The idea here is super simple - check how much is current attribute used and decide which can be removed from the shop to increase the performance and/or reduce database load. Script might be quite heavy to run at once, thus consider splitting it in two by commenting out some left joins and corresponding count selects.

@borriglione
borriglione / gist:32ece6a306f31c45cc81a66931891d2e
Created July 2, 2018 08:01
Magento Database Anonymization after Live-Database Import
#!/bin/bash
echo "*** This script is anonymizing a DB-dump of the LIVE-DB in the DEMO-Environment ***"
HOST=`grep host ../app/etc/local.xml | sed 's/ *<host>\(.*\)<\/host>/\1/' | sed 's/<!\[CDATA\[//' | sed 's/\]\]>//'`
USER=`grep username ../app/etc/local.xml | sed 's/ *<username>\(.*\)<\/username>/\1/' | sed 's/<!\[CDATA\[//' | sed 's/\]\]>//'`
PASS=`grep password ../app/etc/local.xml | sed 's/ *<password>\(.*\)<\/password>/\1/' | sed 's/<!\[CDATA\[//' | sed 's/\]\]>//'`
NAME=`grep dbname ../app/etc/local.xml | sed 's/ *<dbname>\(.*\)<\/dbname>/\1/' | sed 's/<!\[CDATA\[//' | sed 's/\]\]>//'`
echo ""
@borriglione
borriglione / change_db_owner.sh
Created November 20, 2018 11:17 — forked from gingerlime/change_db_owner.sh
Postgresql - Changing ownership on all tables
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto