Skip to content

Instantly share code, notes, and snippets.

View kilbot's full-sized avatar

Paul Kilmurray kilbot

View GitHub Profile
@kilbot
kilbot / functions.php
Created June 14, 2017 08:48
Hide Fee and Shipping Button from WooCommerce POS
<?php
// this goes in your theme functions.php file
function my_custom_pos_css() {
echo '<style>[data-action="fee"], [data-action="shipping"] { display: none; }</style>';
}
add_action( 'woocommerce_pos_head', 'my_custom_pos_css' );
@kilbot
kilbot / functions.php
Last active May 30, 2017 05:56
Using a wholesale price for all POS products
<?php
// this goes in your theme functions.php file
function my_custom_product_response($response, $product) {
// only change the response for POS requests
if( ! is_pos() ) {
return $response;
}
@kilbot
kilbot / functions.php
Last active June 14, 2017 08:45
Hide WooCommerce POS Product Images
<?php
// this goes in your theme functions.php file
function my_custom_pos_css() {
echo '<style>.products-list .img { display: none; }</style>';
}
add_action( 'woocommerce_pos_head', 'my_custom_pos_css' );
@kilbot
kilbot / receipt.php
Created May 17, 2017 07:14
Custom Receipt Template for WooCommerce POS Pro
<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 / 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' );
@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 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 protected]'; // 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 / 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 / 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 / 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" />