Skip to content

Instantly share code, notes, and snippets.

View ashsmith's full-sized avatar
:shipit:

Ash Smith ashsmith

:shipit:
View GitHub Profile
@ashsmith
ashsmith / local.xml
Created October 9, 2012 10:44
Remove popular search terms page from Google Index.
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalogsearch_term_popular>
<reference name="head">
<action method="setRobots"><value>NOINDEX,NOFOLLOW</value></action>
</reference>
</catalogsearch_term_popular>
</layout>
@ashsmith
ashsmith / post-receive
Created September 1, 2012 21:54
Git push to server, remote repo hook to automatically update a website's filesystem
#!/bin/sh
WEBDIR=/var/www/mysite.com
GIT_WORK_TREE=$WEBDIR git checkout -f
cd $WEBDIR
@ashsmith
ashsmith / Meteorify_Checkout.xml
Created August 16, 2012 19:36
[Not Finished] Override Shipping Method and Payment Steps on Magento Checkout.
<?xml version="1.0"?>
<!-- app/etc/modules/Meteorify_Checkout.xml -->
<config>
<modules>
<Meteorify_Checkout>
<active>true</active>
<codePool>local</codePool>
</Meteorify_Checkout>
</modules>
</config>
<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
<!-- the block is set to show on the individual product page; change the layout name to use this block on other pages.
You can also add the block to other layouts -->
<catalog_product_view>
<reference name="left">
<block type="randomtestimonial/template_random" name="random.testimonial">
<!-- remove comments to set the title of this testimonial block or leave commented out to use the CMS block title -->
<action method="setTitle" translate="title"><title>What Customers Say...</title></action>
<!-- set the cms block identifier prefix for all cms blocks to be used with this template -->
@ashsmith
ashsmith / gist:3181711
Created July 26, 2012 12:13
Line Endings Fix
# Replace all files line endings from current directory onwards.
$ find . -type f -exec perl -pi -e 's/\r\n?/\n/g' {} \;
# Only replace line endings in php files within current directory
$ perl -pi -e 's/\r\n?/\n/g' *.php
@ashsmith
ashsmith / .gitignore
Last active April 22, 2022 00:06
Magento 1.x .gitignore
# Never save database creditentials in your repo. Keep a dummy copy with a different name eg "local.xml.dev"
app/etc/local.xml
downloader
# If you'd like to keep the downloader, use the following instead:
# downloader/.cache
# downloader/cache.cfg
# downloader/connect.cfg
# All of the var folders can be excluded.
@ashsmith
ashsmith / actionsxml.xml
Created May 30, 2012 12:43
Magento 1.7.0.0 Dataflow Profile for Importing Product Images
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA[]]></var>
<var name="fieldnames"></var>
<var name="map">
<map name="sku"><![CDATA[sku]]></map>
<map name="image"><![CDATA[image]]></map>
<map name="image_label"><![CDATA[image_label]]></map>
<map name="small_image"><![CDATA[small_image]]></map>
<map name="small_image_label"><![CDATA[small_image_label]]></map>
@ashsmith
ashsmith / onepage.phtml
Last active April 13, 2023 19:33
Track each step of the Magento onepage checkout in Google Analytics with this simple Javascript addition to [package]/[theme]/template/checkout/onepage.phtml just add it to the bottom of that file and follow up by configuring with Google Analytics goals
<script type="text/javascript">
Checkout.prototype.gotoSection = Checkout.prototype.gotoSection.wrap(function(parentMethod, section, reloadProgressBlock) {
// Call parent method.
parentMethod(section, reloadProgressBlock);
var _gaq = _gaq || [];
try {
// push current checkout section to google analytics if available.