Skip to content

Instantly share code, notes, and snippets.

@timbeadle
timbeadle / Order.cfc
Created August 16, 2018 09:07
Order bean, with toStruct() and toJSON() methods.
component accessors=true hint='Order bean' {
property totalAmount type='Money';
property consumer type='Consumer';
property billing type='Contact';
property shipping type='Contact';
property description type='string';
property items type='array';
property discounts type='array';
property merchant type='Merchant';
<?php
/**
* Pre-populate Woocommerce checkout fields
*/
add_filter('woocommerce_checkout_get_value', function($input, $key ) {
global $current_user;
switch ($key) :
case 'billing_first_name':
case 'shipping_first_name':
return $current_user->first_name;
/*jslint browser: true, sloppy: true */
/*global jQuery */
(function ($) {
$.fn.touchMenuFix = function () {
var hasTouch = ("ontouchstart" in window || ("msMaxTouchPoints" in navigator && navigator.msMaxTouchPoints > 0)),
iOS5 = /iPad|iPod|iPhone/.test(navigator.platform) && "matchMedia" in window,
touchEvent = window.navigator.msPointerEnabled ? "MSPointerDown" : "touchstart",
$dropdowns = $(this);
<!DOCTYPE html>
<html>
<head>
<title>jQuery Validate</title>
<!-- Include jquery & jquery.validate -->
<script type="text/javascript">
$(document).ready(function () {
$('form.validate').validate();
});
</script>