Skip to content

Instantly share code, notes, and snippets.

View kilbot's full-sized avatar

Paul Kilmurray kilbot

View GitHub Profile
@kilbot
kilbot / print.html
Last active October 20, 2025 18:49
Test epos-print via network
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>ePOS-Print</title>
<script type="text/javascript">
// URL of ePOS-Print supported TM printer (Version 4.1 or later)
var url = 'http://10.0.0.201/cgi-bin/epos/service.cgi';
@kilbot
kilbot / functions.php
Created September 9, 2016 10:34
Allow customer edit on WordPress multisite
<?php
// change the CASHIER_ID, and
// add to your functions.php file
add_filter('map_meta_cap', 'wc_pos_map_meta_cap', 10, 3);
function wc_pos_map_meta_cap($caps, $cap, $user_id){
if(is_pos() && $cap == 'edit_users' && $user_id === CASHIER_ID){
$caps = array('edit_users');
@kilbot
kilbot / functions.php
Created September 9, 2016 11:08
Filtering the translations in WooCommerce POS
<?php
// add this to your functions.php file
add_filter('woocommerce_pos_i18n', 'my_custom_woocommerce_pos_i18n');
function my_custom_woocommerce_pos_i18n(array $translations){
$translations['buttons']['shipping'] = 'Livraison';
return $translations;
}
@kilbot
kilbot / template.html
Last active October 27, 2016 08:51
add item price column to receipt template
<tr>
<td class="product">
{{name}}
{{#with meta}}
<dl class="meta">
{{#each []}}
<dt>{{label}}:</dt>
<dd>{{value}}</dd>
{{/each}}
</dl>
@kilbot
kilbot / template-stock-report.php
Created November 1, 2016 18:16 — forked from mikejolley/template-stock-report.php
WooCommerce - Stock Report. A template page snippet to (if you are logged in as admin) output a list of products/stock (which you are managing stock for) ready for printing.
<?php
/*
Template Name: Stock Report :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@kilbot
kilbot / test.html
Created November 19, 2016 16:57
Multiple Class Inheritance In Backbone Collections
<!DOCTYPE html>
<html>
<head>
<title>Multiple Class Inheritance In Backbone Collections</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone-min.js"></script>
</head>
<body>
@kilbot
kilbot / z-report.json
Last active December 6, 2016 16:34
Z-Report Response
[
{
"total_sales": "0.00",
"net_sales": "0.00",
"total_orders": 0,
"total_items": 0,
"total_tax": "0.00",
"total_shipping": "0.00",
"total_refunds": 0,
"total_discount": "0.00",
@kilbot
kilbot / functions.php
Last active May 18, 2022 17:38
Adding a dummy email address at customer creation
<?php
function my_custom_create_customer_data($data){
if(function_exists('is_pos') && is_pos()){
$dummy_email = 'email@example.com'; // note: you would have to generate a unique email address for each user
$data['email'] = ! isset($data['email']) || empty($data['email']) ? $dummy_email : $data['email'];
};
return $data;
}
@kilbot
kilbot / bookmarklet.js
Created March 29, 2017 14:47
Meta Key Bookmarklet
javascript:(function()%7Bjavascript%3A%20(function%20(%24)%20%7B%24('input%5Bname%3D%22meta.label%22%5D').val('Members%20Car%20Registration')%3B%7D(window.jQuery))%7D)()
@kilbot
kilbot / functions.php
Last active April 20, 2017 06:32
Remove all taxes from WooCommerce POS
<?php
// theme functions.php file
function my_custom_wcpos_tax_enabled( $enabled ) {
return is_pos() ? false : $enabled;
}
add_filter( 'wc_tax_enabled', 'my_custom_wcpos_tax_enabled' );