Skip to content

Instantly share code, notes, and snippets.

@kalenjordan
kalenjordan / safer-magento-registration-emails.md
Created March 26, 2015 15:17
Safer Magento Registration Emails

Safer Magento Registration Emails

This is a little idea for a module maybe for a hackathon or something. Magento includes passwords in plain text in registration emails by default. In some cases you can just suppress the password, but in other cases you can't - for example if you have customer service reps creating accounts over the phone that need to generate password and send them to customers.

So - how about integrating with readthenburn.com to send email passwords, or perhaps generating temporary password that expire after a day or two, requiring them to use the forgot password if they didn't login by that time.

@peterjaap
peterjaap / exportAttributesToCsv.php
Created December 10, 2013 15:31
Export Magento attributes and their options to a human-readable CSV file.
<?php
chdir(dirname(__FILE__));
require_once '../app/Mage.php';
Mage::app();
umask(0);
$productModel = Mage::getModel('Mage_Catalog_Model_Product');
$categoryModel = Mage::getModel('Mage_Catalog_Model_Category');
@sandermangel
sandermangel / price.phtml without Weee
Last active November 13, 2018 15:13
The price.phtml template without all the Weee stuff
<?php
/**
* Updated price.phtml without WEEE
*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* http://opensource.org/licenses/mit-license.php
*
@conroyp
conroyp / setup_mailcatcher.sh
Created August 23, 2014 17:31
Mailcatcher installation script for Ubuntu 14.04
#!/bin/bash
# Install dependencies
apt-get install libsqlite3-dev ruby1.9.1-dev
# Install the gem
gem install mailcatcher
# Make it start on boot
echo "@reboot $(which mailcatcher) --ip=0.0.0.0" >> /etc/crontab
update-rc.d cron defaults
@magentogirl
magentogirl / gist:e8dc6aa7c74d021f85cc
Last active January 8, 2019 11:32
config.xml to disable Magento Logging
<?xml version="1.0"?>
<config>
<frontend>
<events>
<!--disable logs-->
<controller_action_predispatch>
<observers><log><type>disabled</type></log></observers>
</controller_action_predispatch>
<controller_action_postdispatch>
<observers><log><type>disabled</type></log></observers>
@molotovbliss
molotovbliss / patch-7136
Created December 21, 2016 21:20
Magento v1 SUPEE-7136 Cookies : 'frontend_cid' is never renewed, compared to 'frontend' one. So session often expires.
Sauce: https://community.magento.com/t5/Technical-Issues/Cookies-frontend-cid-is-never-renewed-compared-to-frontend-one/td-p/41077
The core code seems to have forgotten to include the logic to renew the frontend_cid cookie.
I have contacted Magento support regarding this and they provided me a patch - SUPEE-7136, however I'm not seeing it published online anywhere...
The issue lies in this file:
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php
What the patch does is replace this:
@peterjaap
peterjaap / quickmodman
Created January 16, 2013 10:52
Quickly generate modman file for Magento extensions
for i in `find . -type f | grep -v \.git | grep -v "^.$" | grep -v "modman" | sed 's/\.\///'`; do echo ${i} ${i}; done > modman
@yireo
yireo / create_website_scope.php
Last active October 1, 2020 11:02
Magento script to create a new Website, new Store Group, new Store View and new Root Catalog - all linked together.
<?php
// Base-name
$name = 'foobar';
// Init Magento
require_once 'app/Mage.php';
Mage::app();
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
// Create the root catalog
@therouv
therouv / magento-db-cleanup.sql
Last active November 10, 2020 06:54
DB cleanup script for Magento with some common database tables.
SET FOREIGN_KEY_CHECKS=0;
-- Customers
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
@petemcw
petemcw / magento_sql_snippets.md
Created July 21, 2011 19:41
Magento SQL Snippets

Magento SQL Snippets

Clear Temporary Data Tables

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;