Skip to content

Instantly share code, notes, and snippets.

@ceckoslab
ceckoslab / gist:6120823
Last active December 20, 2015 11:09
Simple script, that shows / extract all email addresses of customers, who made orders in the Magento shop
<?php
/**
* @author Tsvetan Stoychev <ceckoslab@gmail.com>
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/
ini_set('max_execution_time', 0);
define('MAGENTO_ROOT', getcwd());
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
require_once $mageFilename;
@ceckoslab
ceckoslab / gist:5116108
Created March 8, 2013 12:20
New order transactional email content - DE / EN
//DE
<body style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<div style="background:#F6F6F6; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; margin:0; padding:0;">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td align="center" valign="top" style="padding:20px 0 20px 0">
<table bgcolor="#FFFFFF" cellspacing="0" cellpadding="10" border="0" width="650" style="border:1px solid #E0E0E0;">
<!-- [ header starts here] -->
<tr>
@ceckoslab
ceckoslab / gist:4605577
Created January 23, 2013 13:27
A tool, that copied all Product ( name, description and short_description ) from Engslish to Trukish store view
<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();
$englishStoreViewId = 4;
$turkishStoreViewId = 6;
ini_set('display_errors', 1);
@ceckoslab
ceckoslab / gist:4523798
Last active December 11, 2015 01:29
My suggestion for question: "Magento observer not firing" at: http://stackoverflow.com/questions/14301861/magento-observer-not-firing
<modules>
<Hatclub_MembershipHandler>
<version>1.0.0</version>
</Hatclub_MembershipHandler>
</modules>
<global>
......
......
......
</global>
@ceckoslab
ceckoslab / gist:4503260
Created January 10, 2013 16:09
Workaround to unbind the event listeners for the agreement checkboxes
<script type="text/javascript">
//<![CDATA[
// submit buttons are not needed when submitting with ajax
$('review_submit').hide();
if ($('update_shipping_method_submit')) {
$('update_shipping_method_submit').hide();
}
<?php if ($this->getUseAjax()):?>
OrderReviewController.prototype._submitOrder = function() {
@ceckoslab
ceckoslab / tinydump
Last active July 13, 2021 06:44
Simple PHP script, that creates a dump of Magento DB with smaller footprint ... the script just excludes the data some of the log tables, but keep the the schema of these tables.
<?php
define('DS', DIRECTORY_SEPARATOR);
function _getExtractSchemaStatement($sqlFileName, $db)
{
$dumpSchema = 'mysqldump' . ' ';
$dumpSchema .= '--no-data' . ' ';
$dumpSchema .= '-u ' . $db['user'] . ' ';
$dumpSchema .= '-p' . $db['pass'] . ' ';
$dumpSchema .= '-h ' . $db['host'] . ' ';
@ceckoslab
ceckoslab / gist:4194134
Created December 3, 2012 10:39
Detect AW_Blog detect cat and post view actions
$action = Mage::app()->getFrontController()->getAction();
/* Detect blog category view page */
if ($action->getFullActionName() == 'blog_cat_view') {
bla bla bla
}
/* Detect blog post view page */
if ($action->getFullActionName() == 'blog_post_view') {
bla bla bla
@ceckoslab
ceckoslab / gist:4130152
Created November 22, 2012 09:20
sybase
protected function _connect() {
$config = new Zend_Config(
array(
'database' => array(
'adapter' => 'Pdo_Mssql',
'params' => array(
'host' => '127.0.0.1',
'dbname' => 'test',
'username' => 'webuser',
@ceckoslab
ceckoslab / gist:3788828
Created September 26, 2012 15:52
This is just a modified version of the function Mage_Adminhtml_Model_Email_Template::getSystemConfigPathsWhereUsedCurrently() and it returns all the used email templates configuration paths
/**
* Collect all email templates system config paths
*
* @return array
*/
public function getEmailTemplatesSystemConfigPaths()
{
$paths = array();
$configSections = Mage::getSingleton('adminhtml/config')->getSections();
a:8:{s:12:"attribute_id";a:14:{s:11:"SCHEMA_NAME";N;s:10:"TABLE_NAME";s:22:"customer_eav_attribute";s:11:"COLUMN_NAME";s:12:"attribute_id";s:15:"COLUMN_POSITION";i:1;s:9:"DATA_TYPE";s:8:"smallint";s:7:"DEFAULT";N;s:8:"NULLABLE";b:0;s:6:"LENGTH";N;s:5:"SCALE";N;s:9:"PRECISION";N;s:8:"UNSIGNED";b:1;s:7:"PRIMARY";b:1;s:16:"PRIMARY_POSITION";i:1;s:8:"IDENTITY";b:0;}s:10:"is_visible";a:14:{s:11:"SCHEMA_NAME";N;s:10:"TABLE_NAME";s:22:"customer_eav_attribute";s:11:"COLUMN_NAME";s:10:"is_visible";s:15:"COLUMN_POSITION";i:2;s:9:"DATA_TYPE";s:8:"smallint";s:7:"DEFAULT";s:1:"1";s:8:"NULLABLE";b:0;s:6:"LENGTH";N;s:5:"SCALE";N;s:9:"PRECISION";N;s:8:"UNSIGNED";b:1;s:7:"PRIMARY";b:0;s:16:"PRIMARY_POSITION";N;s:8:"IDENTITY";b:0;}s:12:"input_filter";a:14:{s:11:"SCHEMA_NAME";N;s:10:"TABLE_NAME";s:22:"customer_eav_attribute";s:11:"COLUMN_NAME";s:12:"input_filter";s:15:"COLUMN_POSITION";i:3;s:9:"DATA_TYPE";s:7:"varchar";s:7:"DEFAULT";N;s:8:"NULLABLE";b:1;s:6:"LENGTH";s:3:"255";s:5:"SCALE";N;s:9:"PRECISION";N;s:8:"UNSIGNED";N;s:7