Skip to content

Instantly share code, notes, and snippets.

View kilbot's full-sized avatar

Paul Kilmurray kilbot

View GitHub Profile
@kilbot
kilbot / snippet.php
Last active June 17, 2016 04:23
Change default order filters to Pending & Processing
/**
* Change default filter of orders in WP admin
* add this to your functions.php file
*/
add_action( 'admin_menu', 'change_default_order_filter', 99 );
function change_default_order_filter() {
global $submenu;
if (isset($submenu['woocommerce'])) {
$submenu['woocommerce'][1][2] = 'edit.php?post_type=shop_order&shop_order_status=pending,processing';
}
@kilbot
kilbot / gist:cd978bc863ee1968c4b8
Last active August 29, 2015 14:14
Add to the theme functions.php file
function log_new_orders() {
error_reporting(0);
$log = new WC_Logger();
$log->add('woocommerce-pos', print_r(debug_backtrace(), true));
}
add_action( 'save_post_shop_order', 'log_new_orders' );
@kilbot
kilbot / gist:1629c80ff1443dc5e7fa
Created February 1, 2015 11:33
Add to the theme functions.php
function log_all_emails($mail) {
error_reporting(0);
$log = new WC_Logger();
$log->add('woocommerce-pos', print_r($mail, true));
return $mail;
}
add_filter( 'wp_mail', 'log_all_emails' );
@kilbot
kilbot / receipt.php
Last active November 22, 2017 06:10
WooCommerce POS Receipt Template - https://docs.wcpos.com/en/receipts.html
<html>
<head>
<meta charset="utf-8">
<title><?php _e( 'Receipt', 'woocommerce-pos' ); ?></title>
<style>
/* Reset */
* {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
@kilbot
kilbot / receipt.php
Last active March 13, 2019 15:06
WooCommerce POS Pro Receipt Template
<html>
<head>
<meta charset="utf-8">
<title><?php _e( 'Receipt', 'woocommerce-pos' ); ?></title>
<style>
/* Reset */
* {
background: transparent !important;
color: #000 !important;
box-shadow: none !important;
{
"product": {
"title": "Glasschale \"Grosse Welle\"",
"id": 4116,
"created_at": "2012-04-09T20:29:31Z",
"updated_at": "2015-03-14T10:26:32Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
{
"product": {
"title": "L\u00f6we aus recycelten Flip Flops",
"id": 12250,
"created_at": "2015-05-04T20:50:38Z",
"updated_at": "2015-05-06T10:48:46Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
{
"product": {
"title": "Y-Ply",
"id": 7480,
"created_at": "2013-03-09T14:35:36Z",
"updated_at": "2014-06-26T21:31:51Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
@kilbot
kilbot / Between Battles
Created June 12, 2015 03:18
product.json
{
"product": {
"title": "Between Battles",
"id": 27540,
"created_at": "2015-06-12T00:59:52Z",
"updated_at": "2015-06-12T01:08:11Z",
"type": "variable",
"status": "publish",
"downloadable": false,
"virtual": false,
@kilbot
kilbot / wp-tests-config.php
Created June 14, 2015 16:44
wp-tests-config.php
<?php
/* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
define( 'ABSPATH', '/srv/www/woopos/htdocs/' );
// Test with multisite enabled.
// Alternatively, use the tests/phpunit/multisite.xml configuration file.
// define( 'WP_TESTS_MULTISITE', true );
// Force known bugs to be run.