Skip to content

Instantly share code, notes, and snippets.

@kkrieger85
kkrieger85 / default.xml
Created July 3, 2016 07:30
Remove product comparison from Magento2 Frontend Tested with Magento2 2.1.0 app/design/frontend/VENDOR/THEME/Magento_Catalog/layout/default.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
</head>
<body>
<referenceBlock name="top.links">
<referenceBlock name="catalog.compare.link" remove="true"/>
</referenceBlock>
<referenceBlock name="sidebar.additional">
@kkrieger85
kkrieger85 / composer.json
Created July 3, 2016 08:14
Composer Magento 2.1.0
{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
@kkrieger85
kkrieger85 / README-Template.md
Last active July 15, 2017 13:15 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kkrieger85
kkrieger85 / phpversion.sh
Created November 6, 2016 09:46 — forked from vjandrea/phpversion.sh
Change php cli version in plesk
#!/bin/sh
printf "Switching php to version 5.6 with symlinks.\n"
printf "Press any key to continue...\n"
read CONTINUE
printf "Creating backups..."
# Backup original binaries
@kkrieger85
kkrieger85 / customer-install-0.1.0.php
Created December 12, 2016 18:54 — forked from jzahedieh/customer-install-0.1.0.php
Magento Customer Attribute Setup
<?php
/* @var $installer Mage_Customer_Model_Resource_Setup */
$installer = Mage::getResourceModel('customer/setup','customer_setup');
$installer->startSetup();
if (!$installer->getAttributeId('customer', 'attribute_name')) {
$installer->addAttribute('customer', 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
/** Standard values defined @see Mage_Eav_Model_Entity_Setup::_prepareValues() */
'label' => 'Label', // eav_attribute.frontend_label admin input label
'backend' => 'module/class_name', // eav_attribute.backend_model backend class (module/class_name format)
@kkrieger85
kkrieger85 / product-install-0.1.0.php
Created December 15, 2016 05:17 — forked from jzahedieh/product-install-0.1.0.php
Magento Product Attribute Setup
<?php
$installer = Mage::getResourceModel('catalog/setup', 'catalog_setup');
if (!$installer->getAttributeId(Mage_Catalog_Model_Product::ENTITY, 'attribute_name')) {
$installer->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'attribute_name', array( // TABLE.COLUMN: DESCRIPTION:
/** Standard values defined @see Mage_Eav_Model_Entity_Setup::_prepareValues() */
'label' => 'Label', // eav_attribute.frontend_label admin input label
'backend' => 'module/class_name', // eav_attribute.backend_model backend class (module/class_name format)
'type' => 'varchar', // eav_attribute.backend_type backend storage type (varchar, text etc)
@kkrieger85
kkrieger85 / crontab -e
Created July 15, 2017 13:13
Clear Magento1 sessions files
# kkrieger: clean magento sessions
0 2 * * * /usr/bin/find /PATH/TO/MAGENTO/var/cache -mindepth 1 -maxdepth 1 -type f -cmin +360 -print0 -exec rm {} \; >/dev/null 2>&1
@kkrieger85
kkrieger85 / shell_delete_unused_images
Created August 17, 2017 09:37 — forked from aleron75/shell_delete_unused_images
Delete no more used Product Images on Magento
<?php
require_once 'abstract.php';
class Mage_Shell_CheckImages extends Mage_Shell_Abstract
{
const CATALOG_PRODUCT = '/catalog/product';
const CACHE = '/cache/';
protected function _glob_recursive($pattern, $flags = 0)
@kkrieger85
kkrieger85 / jv_clean_product_images.php
Created August 17, 2017 09:37 — forked from jeroenvermeulen/jv_clean_product_images.php
Script to clean up unused Magento images
#!/usr/bin/php
<?php
/**
* jv_clean_product_images.php
*
* 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:
@kkrieger85
kkrieger85 / convertImages.sh
Created August 17, 2017 09:37 — forked from jeroenvermeulen/convertImages.sh
Convert images to smaller size and lower quality to reduce file sizes for Magento's original product photos
#!/bin/bash
# convertImages.sh
# Authors: Peter Jaap Blaakmeer (elgentos.nl) & Jeroen Vermeulen (magehost.pro)
# https://gist.github.com/peterjaap/7080989
# https://gist.github.com/jeroenvermeulen/feb819799dea3d74ae9c
NEWQUALITY=90
NEWWIDTH=2000
DIRECTORY=$HOME/httpdocs/media/catalog/product/