Skip to content

Instantly share code, notes, and snippets.

View twoelevenjay's full-sized avatar
🏠
Working from home

Leon Francis Shelhamer twoelevenjay

🏠
Working from home
View GitHub Profile
@twoelevenjay
twoelevenjay / gist:e8a63c3b12ee32521dee
Last active October 31, 2015 09:44 — forked from dasher/gist:4391953
Litecoin Supernodes
addnode=83.169.3.31
addnode=82.226.138.81
addnode=93.62.173.122
addnode=94.23.253.228
addnode=91.121.174.223
addnode=188.120.246.137
addnode=12.23.127.175
addnode=99.243.145.178
addnode=79.142.22.72
addnode=198.23.159.10
@twoelevenjay
twoelevenjay / gist:8f83b7db58696e1181b4
Created October 3, 2015 04:49 — forked from corsonr/gist:9152652
WooCommerce : add custom fields to product variations
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 );
/**
@twoelevenjay
twoelevenjay / woocommerce-heads-up-email.php
Created July 20, 2014 21:48
Function to have WooCommerce send an automatic heads up email to the shop owner for orders that switch to a status of on-hold.
add_action('woocommerce_order_status_changed', 'send_hold_email');
function send_hold_email($order_id) {
$order_data = new WC_Order($order_id);
if ($order_data->status=='on-hold') {
global $woocommerce;
$mailer = $woocommerce->mailer();
$message = $mailer->wrap_message(
__( 'Order placed On-hold', 'woocommerce' ),
@twoelevenjay
twoelevenjay / woocommerce-support-email.php
Created July 20, 2014 21:46
Function to have WooCommerce send an automatic support email to the customer for orders that switch to a status of cancelled.
<?php
add_action('woocommerce_order_status_changed', 'send_support_email');
function send_support_email($order_id) {
$order_data = new WC_Order($order_id);
global $woocommerce;
$mailer = $woocommerce->mailer();
if ($order_data->status=='cancelled') {
$to = $order_data->billing_first_name . ' <' . $order_data->billing_email . '>';