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 / 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.
@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 / ps_opt_p_enabled_for_alpine.sh
Created March 27, 2019 13:40 — forked from benok/ps_opt_p_enabled_for_alpine.sh
Enable "ps [-p|--pid] PID" for /bin/ps from busybox (like Alpine Linux)
#!/bin/sh
# enable "ps [-p] PID" for /bin/ps from busybox (like Alpine)
# copy this script as /usr/local/bin/ps or /usr/bin/ps, and chmod 755 it.
if [ $# == 1 ]; then
echo $1 | grep -q -E '^[0-9]+$' # number only argument
if [ $? == 0 ]; then
OPT_P=1
ARG_P=$1
fi
@ashsmith
ashsmith / di.xml
Last active December 9, 2019 21:38
<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
<arguments>
<argument name="extensions" xsi:type="array">
<item name="image_allowed" xsi:type="array">
<item name="svg" xsi:type="string">image/svg+xml</item>
</item>
</argument>
</arguments>
</type>

Keybase proof

I hereby claim:

  • I am ashsmith on github.
  • I am ashsmithco (https://keybase.io/ashsmithco) on keybase.
  • I have a public key ASD-2LpasgMgAYQtopgcqsXXfxiWb1RulBqaQqehaHeZMAo

To claim this, I am signing this object:

@ashsmith
ashsmith / Controller-Edit.php
Last active August 28, 2019 13:55
M2 module from scratch - p5 - adminhtml
<?php
namespace Ashsmith\Blog\Controller\Adminhtml\Post;
use Magento\Backend\App\Action;
class Edit extends \Magento\Backend\App\Action
{
/**
* Core registry
*
@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>
@ashsmith
ashsmith / update_order_numbers_1.sql
Last active November 8, 2017 19:16
Magento: Update Order Numbers SQL
-- Update Order increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '5';`
-- Update Invoice increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '6';
-- Update Credit Memo increment id to start at 123456789
UPDATE `eav_entity_store` SET `increment_last_id` = '123456789' WHERE `entity_type_id` = '7';
-- Update Shipment increment id to start at 123456789
@ashsmith
ashsmith / default_2.1.vcl
Created April 21, 2013 12:00
Varnish Cache for Magento configuration..
# This configuration is what is provided by PageCache by Varnish for Magento module:
# http://www.magentocommerce.com/magento-connect/pagecache-powered-by-varnish.html
# default backend definition. Set this to point to your content server.
backend default {
.host = "127.0.0.1";
.port = "80";
}
# admin backend with longer timeout values. Set this to the same IP & port as your default server.
@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>