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 June 5, 2025 15:43
Migrate POS orders from Actuality Extensions
<?php
function wcpos_update_created_via_field() {
$batch_size = 100;
$page = 1;
do {
$orders = wc_get_orders( [
'limit' => $batch_size,
'page' => $page,
@kilbot
kilbot / functions.php
Created May 5, 2025 16:59
Force TaxJar to use POS store shipping address
<?php
// add to your functions.php file
function apply_pos_forced_shipping_address( $order, $request, $creating ) {
// only apply on order creation
if ( ! $creating ) {
return $order;
}
// only apply for POS orders
@kilbot
kilbot / functions.php
Last active April 3, 2025 15:44
Example custom product response for POS Stores
<?php
/**
* add to your theme functions.php file
*/
function my_custom_product_response( $response, $product, $request ) {
// only intercept requests from the POS
if( ! function_exists('woocommerce_pos_request') || ! woocommerce_pos_request() )
return $response;
$store_id = $request->get_param( 'store_id' );
@kilbot
kilbot / receipt.php
Created December 21, 2024 12:07
Receipt template for WooCommerce POS Pro
<?php
/**
* Sales Receipt Template.
*
* This template can be overridden by copying it to yourtheme/woocommerce-pos/receipt.php.
* HOWEVER, this is not recommended , don't be surprised if your POS breaks
*/
if ( ! \defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
@kilbot
kilbot / payment.php
Created December 9, 2024 22:32
Custom payment.php template with integration for PW Gift Cards
<?php
/**
* POS Order Pay template.
*
* This template can be overridden by copying it to yourtheme/woocommerce-pos/payment.php.
* HOWEVER, this is not recommended , don't be surprised if your POS breaks
*/
defined( 'ABSPATH' ) || exit;
@kilbot
kilbot / PushOrdersJob.php
Created December 5, 2024 20:55
The code which handles pushing WooCommerce orders to the terminal
<?php
/**
* Poynt — a GoDaddy Brand for WooCommerce.
*
* @author GoDaddy
* @copyright Copyright (c) 2021 GoDaddy Operating Company, LLC. All Rights Reserved.
* @license GPL-2.0
*/
namespace GoDaddy\WooCommerce\Poynt\Sync\Jobs;
@kilbot
kilbot / functions.php
Last active November 22, 2024 14:38
Bypass status check for Vipps gateway
<?php
/**
* Add this to your theme's functions.php file.
*/
function validate_pos_order_status($has_status, $order, $status ) {
if (
/**
* Only applies if these conditions are met
* - Only check for requests coming from the POS.
* - Must have 'pos-open' status.
@kilbot
kilbot / database.ts
Last active October 9, 2024 07:29
RxStorage adapter for expo-sqlite
import { createRxDatabase } from 'rxdb';
import { getRxStorageSQLite, SQLiteQueryWithParams } from 'rxdb-premium/plugins/sqlite';
import { openDatabase, WebSQLDatabase, ResultSet } from 'expo-sqlite';
/**
* Polyfill for TextEncoder
* fixes: ReferenceError: Can't find variable: TextEncoder
*/
import 'fast-text-encoding';
@kilbot
kilbot / functions.php
Last active August 23, 2024 12:59
Triggering the Lottery for WooCommerce plugin from the WC REST API
<?php
/**
* Add this to your theme's functions.php file.
*/
function wc_rest_create_ticket_on_placing_order($order, $request) {
if (class_exists('LTY_Order_Handler')) {
// Get the order ID
$order_id = $order->get_id();