This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
<title>Google Maps JavaScript API Example: Street View with Map</title> | |
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/standard.css" rel="stylesheet" type="text/css" /> | |
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | |
<script type="text/javascript"> | |
function initialize() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: AWD Weight/State Shipping | |
* Plugin URI: http://www.andyswebdesign.ie/blog/free-woocommerce-weight-and-country-based-shipping-extension-plugin/ | |
* Description: Weight and State based shipping method for Woocommerce. | |
* Version: 1.0.1 | |
* Author: Andy_P (modified by Mantish to make it state based) | |
*/ | |
/** Copyright 2012 andyswebdesign.ie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Display field value on the admin order edit page | |
*/ | |
add_action( 'woocommerce_admin_order_data_after_billing_address', 'my_custom_checkout_field_display_admin_order_meta', 10, 1 ); | |
function my_custom_checkout_field_display_admin_order_meta($order){ | |
echo '<p><strong>'.__('My Field').':</strong> ' . get_post_meta( $order->id, 'My Field', true ) . '</p>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Disable PayPal payment method in the checkout if certain | |
* products are present in the cart. | |
* | |
* Add this to your theme's functions.php file | |
*/ | |
add_filter( 'woocommerce_available_payment_gateways', 'filter_gateways', 1); | |
function filter_gateways( $gateways ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Display Fields | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
// Save Fields | |
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' ); | |
function woo_add_custom_general_fields() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce Extra Feature | |
* -------------------------- | |
* | |
* Display product meta field in a shortcode | |
* ex: [woo_custom_field id="my-custom-field"] | |
* | |
*/ | |
function woo_custom_field_shortcode( $atts, $content = null ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('input#choice_13_1').click(function() { | |
if($(this).is(':checked')) { | |
$('#input_2_12_1').val($('#input_2_2_1').val()); | |
$('#input_2_12_2').val($('#input_2_2_2').val()); | |
$('#input_2_12_3').val($('#input_2_2_3').val()); | |
$('#input_2_12_4').val($('#input_2_2_4').val()); | |
$('#input_2_12_5').val($('#input_2_2_5').val()); | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bindGformHandlers() { | |
//bind the click function | |
$(document).on('click', '.fill-check input', function() { | |
if($(this).is(':checked')) { | |
//put in the selectors we fill from | |
var fill_from = $('.fill-from, .fill-from .name_last, .fill-from .name_first'); | |
fill_from.each(function() { | |
//get the label |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a failed order email notification | |
*/ | |
function sp_failed_order_email_notification( $order_id ) { | |
$order = wc_get_order( $order_id ); | |
$to = get_option( 'admin_email' ); | |
$subject = 'A order failed, action required'; |
OlderNewer