Skip to content

Instantly share code, notes, and snippets.

Raja rajakannan

Block or report user

Report or block rajakannan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rajakannan / 0_reuse_code.js
Created Jun 6, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
rajakannan / Streetview_with_road_map_binded.html
Last active Aug 29, 2015
Displaying a road map on top of the street view and binding them
View Streetview_with_road_map_binded.html
<!DOCTYPE html>
<html xmlns="" xmlns:v="urn:schemas-microsoft-com:vml">
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example: Street View with Map</title>
<link href="" rel="stylesheet" type="text/css" />
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
View shipping-awd.php
* Plugin Name: AWD Weight/State Shipping
* Plugin URI:
* 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
rajakannan / woocommerce.php
Last active Nov 15, 2019
Collection of essential snippets
View woocommerce.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>';
rajakannan / Disable_PayPal_payment_method_in_the_checkout.php
Last active Nov 15, 2019
Disable PayPal payment method in the checkout
View Disable_PayPal_payment_method_in_the_checkout.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 ){
View Woocommerce-product-meta.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() {
rajakannan / wc-product-meta-display.php
Created Mar 1, 2015
Here is a quick snippet to display WooCommerce product custom meta fields values (place it in functions.php):
View wc-product-meta-display.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 ) {
rajakannan / gformscopyaddress.js
Created Jan 7, 2016 — forked from tnorthcutt/gformscopyaddress.js
Autofill a set of fields (in a gravity form, in this case) based on a checkbox being checked.
View gformscopyaddress.js
jQuery(document).ready(function($) {
$('input#choice_13_1').click(function() {
if($(this).is(':checked')) {
rajakannan / gv-copy-.js
Created Jan 7, 2016
Gravity Form copy form fields (Eg: same as billing address check box for shipping address )
View gv-copy-.js
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
rajakannan / woocommerce-failed-order-email-notification.php
Created Mar 14, 2016
WooCommerce failed order email notification
View woocommerce-failed-order-email-notification.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';
You can’t perform that action at this time.