Skip to content

Instantly share code, notes, and snippets.

@SethWilson
Created February 23, 2012 21:51
Show Gist options
  • Save SethWilson/1895262 to your computer and use it in GitHub Desktop.
Save SethWilson/1895262 to your computer and use it in GitHub Desktop.
Complete Checkout
/**
* complete_checkout.js
*
* This little bookmarklet populates the checkout screen with default values
*
* MIT Licensed.
*
* Copyright 2011-2012 Seth Wilson @SethWilson
*
* ------------------------------------------------
* author: Seth Wilson
* version: 0.1
* url:
* source:
*/
function runthis() {
// your JavaScript code goes here!
$('input[name$="firstname"]').val('Seth');
$('input[name$="lastname"]').val('Wilson');
$('input[name$="address"]').val('27 Bannisdale Way');
$('input[name$="city"]').val('Carlisle');
$('input[name$="postal"]').val('L0R 1H2');
$('input[name$="email"]').val('[email protected]');
$('input[name$="phone"]').val('905-690-7127');
$('select[name$="province"]').val("ON");
}
if (typeof jQuery == 'undefined') {
var jQ = document.createElement('script');
jQ.type = 'text/javascript';
jQ.onload=runthis;
jQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
document.body.appendChild(jQ);
} else {
runthis();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment