Skip to content

Instantly share code, notes, and snippets.

@marcusthor
marcusthor / admin_hints.sql
Created September 9, 2012 08:21 — forked from davidalexander/gist:1086455
Magento Snippets
// enable template hints in admin
INSERT INTO core_config_data (scope, scope_id, path, value)
VALUES ('default', 0, 'dev/debug/template_hints', 1),
('default', 0, 'dev/debug/template_hints_blocks', 1);
@marcusthor
marcusthor / CertiLinks.md
Last active November 11, 2017 16:21 — forked from ecogswell/gist:3352027
Magento Certification Study Links
@marcusthor
marcusthor / gist:3939390
Created October 23, 2012 15:20 — forked from cmuench/gist:3082029
Magento: Save multiple models in one transaction
<?php
// $foo = Mage::getModel('.....
// $bar = Mage::getModel('.....
$transaction = Mage::getModel('core/resource_transaction');
$transaction->addObject($foo);
$transaction->addObject($bar);
$transaction->save(); // runs save on all objects. On error -> rollback

My Magento Snippets

Checkout virtual - downloadable product

<?php

require_once '../app/Mage.php';
 
Varien_Profiler::enable();
SET @entityid = '3';
SELECT ea.attribute_id, ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
FROM catalog_category_entity e
JOIN catalog_category_entity_varchar eav
ON e.entity_id = eav.entity_id
JOIN eav_attribute ea
ON eav.attribute_id = ea.attribute_id
WHERE e.entity_id = @entityid
UNION
#
# Customized VCL file for serving up a Drupal site with multiple back-ends.
#
# For more information on this VCL, visit the Lullabot article:
# http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal
#
# Define the internal network subnet.
# These are used below to allow internal access to certain files while not
# allowing access from the public internet.
# Use one of the download links here: http://phantomjs.org/download.html
# In this case, it's the 32-bit version.
sudo yum install freetype fontconfig
cd ~
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-i686.tar.bz2
bunzip2 phantomjs*.tar.bz2
tar xvf phantomjs*.tar
sudo cp phantomjs*/bin/phantomjs /usr/bin/phantomjs
phantomjs -v