Skip to content

Instantly share code, notes, and snippets.

View mklooss's full-sized avatar

Mathis Klooß mklooss

View GitHub Profile
@mklooss
mklooss / gist:bea85aa34aeb4b098023
Created June 2, 2014 13:21
copy Parent/Simple Category to each other
<?php
require 'app/Mage.php';
Mage::app('admin');
$resource = Mage::getSingleton('core/resource');
/* @var $resource Mage_Core_Model_Resource */
$conn = $resource->getConnection('core_write');
/* @var $conn Varien_Db_Adapter_Interface */
@mklooss
mklooss / class.php
Created June 12, 2014 07:04
Magento: The Directive on Consumer Rights - 2014-06-13 - Helper
<?php
/**
class required this modul:
https://github.com/integer-net/Autoshipping
*/
class Custom_Module_Helper_Eu_Shipment
extends Mage_Core_Helper_Abstract
{
@mklooss
mklooss / shopping.php
Last active June 7, 2017 21:23
Magento Google Shopping - Simple Script
<?php
if(php_sapi_name() != 'cli')
{
die('only via cli');
}
require 'app/Mage.php';
umask(0);
@mklooss
mklooss / Configurator.php
Created June 27, 2014 11:47
M2E Fix for Tax on Shipping Costs issues - ebay orders- thanks to M2E support :) - for version 6.1.6
<?php
/*
* @copyright Copyright (c) 2013 by ESS-UA.
*/
/**
* Configures the store settings to match account settings and order information
*/
class Ess_M2ePro_Model_Magento_Quote_Store_Configurator
@mklooss
mklooss / jpegcompress.sh
Last active September 26, 2017 07:29
optipng / jpegoptim
#!/bin/bash
# combine mozjpeg and jpegoptim
# you have to build https://github.com/mozilla/mozjpeg first
# path = /opt/mozjpeg
# ~# find . -iname "*.jp*g" -type f -exec jpegcompress "{}" \;
if [ -z "$1" ]; then
echo "is empty"
exit;
@mklooss
mklooss / addItemsM2e.php
Last active August 29, 2015 14:03
Auto Add Items to Amazon Listing - m2e
<?php
if(php_sapi_name() != 'cli')
{
echo "only for cli!";
exit;
}
require 'app/Mage.php';
Mage::app('admin');
@mklooss
mklooss / Helper_Search.php
Created July 15, 2014 14:46
Add Category Names to CatalogSearch
<?php
class Custom_MyModule_Helper_Search
extends Mage_CatalogSearch_Helper_Data
{
public function getSearchableDataFromCategory($productId, $storeId)
{
$result = array();
$default = Mage::app()->getStore($storeId)->getRootCategoryId();
$adapter = Mage::getSingleton('core/resource')->getConnection('core_read');
@mklooss
mklooss / Observer.php
Created September 17, 2014 14:07
Mage Disable Key Validation
<?php
class Observer
{
/**
* mageEvent: <controller_action_predispatch_checkout_cart_add>
*
*/
public function addDisableValidatFromKey(Varien_Event_Observer $observer)
{
$controller = $observer->getControllerAction();
@mklooss
mklooss / OE 2.2 Repository (apt - trivial)
Last active December 16, 2016 20:36
OE 2.2 Repository (apt/trivial)
Creates an Trivial Repository for OE 2.2 Based on Data from http://git.opendreambox.org/
while creating the repository there will be a new folder "../signed".
I need this folder, so i do not double sign a package.
@mklooss
mklooss / configurable.phtml
Created October 22, 2014 08:29
Show Attribute Name in Select Box on an Configurable Product
<script type="text/javascript">
Product.Config.prototype.fillSelect = function(element){
var attributeId = element.id.replace(/[a-z]*/, '');
var options = this.getAttributeOptions(attributeId);
this.clearSelect(element);
element.options[0] = new Option('', '');
element.options[0].innerHTML = this.config.attributes[attributeId].label + ' <?php echo $this->__('Choose') ?>';
var prevConfig = false;
if(element.prevSetting){