Skip to content

Instantly share code, notes, and snippets.

View borriglione's full-sized avatar

André Herrn borriglione

View GitHub Profile
@borriglione
borriglione / change_taxrate.php
Last active June 8, 2020 17:44
Magento1 tax rate changing script (originally developed for Corona-caused tax rate change in Germany)
<?php
require_once 'abstract.php';
class TaxrateChange extends Mage_Shell_Abstract
{
public function run()
{
$this->validateInput();
$this->changeTaxRate();
diff --git a/Mail/Message.php b/Mail/Message.php
index 1f423e801087..0e4d79aac933 100644
--- a/Mail/Message.php
+++ b/Mail/Message.php
@@ -171,7 +171,6 @@ private function createMimeFromString($body, $messageType)
$part = new Part($body);
$part->setCharset($this->zendMessage->getEncoding());
$part->setEncoding(Mime::ENCODING_QUOTEDPRINTABLE);
- $part->setDisposition(Mime::DISPOSITION_INLINE);
$part->setType($messageType);
@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
@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 / 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: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>
<?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: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`
@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