Skip to content

Instantly share code, notes, and snippets.

View shinesoftware's full-sized avatar

Shine Software shinesoftware

View GitHub Profile
@Stasevi4
Stasevi4 / ProductimgFix.patch
Last active June 22, 2018 05:58
Magento Fix Undefined index - app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php on line 145
diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
index 13e8659..f7000df 100755
--- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
+++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php
@@ -141,12 +141,12 @@ class Mage_ConfigurableSwatches_Helper_Productimg extends Mage_Core_Helper_Abstr
$swatchLabel = $label . self::SWATCH_LABEL_SUFFIX;
$imageKeys[$label] = array_search($label, $imageHaystack);
- if ($imageKeys[$label] === false) {
+ if ($imageKeys[$label] === false && array_keys($mapping, $label)) {
@SchumacherFM
SchumacherFM / pt-duplicate-key-checker.sql
Last active February 5, 2023 15:10
pt-duplicate-key-checker for Magento 1.8 MySQL database. Less indexes the faster the update/insert statement
# ########################################################################
# api2_acl_attribute
# ########################################################################
# IDX_API2_ACL_ATTRIBUTE_USER_TYPE is a left-prefix of UNQ_API2_ACL_ATTRIBUTE_USER_TYPE_RESOURCE_ID_OPERATION
# Key definitions:
# KEY `IDX_API2_ACL_ATTRIBUTE_USER_TYPE` (`user_type`)
# UNIQUE KEY `UNQ_API2_ACL_ATTRIBUTE_USER_TYPE_RESOURCE_ID_OPERATION` (`user_type`,`resource_id`,`operation`),
# Column types:
# `user_type` varchar(20) not null comment 'type of user'
@istepanov
istepanov / install_gettext.sh
Created October 24, 2012 10:46
Compile and install gettext.so PHP extension for Mac OS X 10.8 Mountain Lion
#!/usr/bin/sh
# Scipt for installing mcrypt.so extension for PHP 5.3.13 (default PHP for OS X 10.8 Mountain Lion)
mkdir /tmp/gettext
cd /tmp/gettext
curl --location --progress-bar http://us.php.net/get/php-5.3.13.tar.gz/from/nl.php.net/mirror | tar -zx
brew update
@messyOne
messyOne / Module.php
Created October 10, 2012 09:17
Insert user_id in user_role_linker
public function onBootstrap($e)
{
$app = $e->getTarget();
$sm = $app->getServiceManager();
$adapter = $sm->get('Zend\Db\Adapter\Adapter');
// adding action for user registration
$zfcServiceEvents = $sm->get('zfcuser_user_service')->getEventManager();
$zfcServiceEvents->attach(
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>