Skip to content

Instantly share code, notes, and snippets.

View firewizard's full-sized avatar

Cristian Nicolescu firewizard

View GitHub Profile
diff --git a/magento/app/code/core/Mage/Cms/Block/Block.php b/magento/app/code/core/Mage/Cms/Block/Block.php
index 75aab46..3693349 100644
--- a/magento/app/code/core/Mage/Cms/Block/Block.php
+++ b/magento/app/code/core/Mage/Cms/Block/Block.php
@@ -72,4 +72,19 @@ class Mage_Cms_Block_Block extends Mage_Core_Block_Abstract
}
return $html;
}
+
+ /**
diff --git a/magento/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/magento/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php
index c07e179..e3ba1e6 100644
--- a/magento/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php
+++ b/magento/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php
@@ -111,6 +111,12 @@
// $aggregatorArr = explode('/', $this->getAggregator());
// $this->setValue((int)$aggregatorArr[0])->setAggregator($aggregatorArr[1]);
+ // The parent class is passing children of configurable items to this method again
+ // this is causing an infinite recursion if we let it pass
@TahaSh
TahaSh / helpers.php
Last active May 27, 2017 20:24
Source code: How to Create a Reusable Modal Box in Laravel & VueJS
<?php
function showModal($id, array $data = [])
{
$toJSON = json_encode($data);
return "showModal('$id', $toJSON)";
}
@pinedamg
pinedamg / 1.markdown
Created July 23, 2012 18:10
My Magento Snippets

My Magento Snippets

Checkout virtual - downloadable product

<?php

require_once '../app/Mage.php';
 
Varien_Profiler::enable();
@rodrigowebjump
rodrigowebjump / magento-format-number.php
Created September 16, 2014 13:39
Magento format number locale Magento formatar número respeitando a localização
<?php echo Zend_Locale_Format::toNumber($_interest, array('locale' => new Zend_Locale(Mage::app()->getLocale()->getLocale()))); ?>
@SchumacherFM
SchumacherFM / README.md
Last active September 21, 2018 10:05
Avoiding database deadlocks in Magento 1.7

After having many deadlocks due to a high order volumne I've applied the these fixes to the core. Some can be found in a Magento forum. Before the fixes we could only process 1 order every 5-10 secs. Updating to Magento 1.8 is currently not an option but in 1-2 months.

1st Deadlock

Mage_Sales_Model_Abstract::_afterSave must be removed and replaced with afterCommitCallback. This is important to move the grid update (of sales_flat_order_grid) out of the transaction.

2nd Deadlock

Rewrite the method of the Mage_CatalogInventory_Model_Observer::reindexQuoteInventory() to remove the price reindexing from the transaction. That index process will also be fired in event sales_model_service_quote_submit_success.

@stansmet
stansmet / .siegerc
Created July 7, 2012 20:26
My siegerc
# Updated by Siege 2.72, July-07-2012
# Copyright 2000-2007 by Jeffrey Fulmer, et al.
#
# Siege configuration file -- edit as necessary
# For more information about configuring and running
# this program, visit: http://www.joedog.org/
#
# Variable declarations. You can set variables here
# for use in the directives below. Example:
@colinmollenhour
colinmollenhour / mysql_monitor.sh
Last active March 6, 2019 02:03
MySQL Monitor (like 'redis-cli MONITOR')
#!/bin/bash
#
# Monitor MySQL queries
# @author Colin Mollenhour
set -e
mysql="mysql"
test="test"
bash="bash"
@piotrekkaminski
piotrekkaminski / MPERF-10565.diff
Created April 8, 2019 18:04
MPERF-10565.diff - logging to a file that does not exist issue
diff --git a/app/Mage.php b/app/Mage.php
index 0e650eebb4f..9c18e222689 100644
--- a/app/Mage.php
+++ b/app/Mage.php
@@ -798,9 +798,9 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
',',
(string) self::getConfig()->getNode('dev/log/allowedFileExtensions', Mage_Core_Model_Store::DEFAULT_CODE)
);
- $logValidator = new Zend_Validate_File_Extension($_allowedFileExtensions);
$logDir = self::getBaseDir('var') . DS . 'log';
@colinmollenhour
colinmollenhour / Config.php
Last active April 22, 2020 09:45
Stampede-resistant Config Cache
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php