This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce POS Gateways | |
* Plugin URI: https://wordpress.org/plugins/woocommerce-pos/ | |
* Description: Extends WooCommerce with multiple POS gateways. | |
* Version: 1.0.0 | |
* Author: kilbot | |
* Author URI: http://wcpos.com | |
* License: GPL-3.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This would go in your theme fucntions.php file, or you could create a new plugin | |
/** | |
* Change Email Subject and Heading | |
*/ | |
function wc_custom_email_template_order_details( $order, $sent_to_admin, $plain_text, $email ) { | |
// If POS order, change the template | |
if ( $order->get_meta( '_pos' ) ) { | |
// Example: Change the email heading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title><?php _e( 'Receipt', 'woocommerce-pos' ); ?></title> | |
<style type="text/css"> | |
/* ==========* | |
* HTML TAGS * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to custom functions | |
add_filter( 'option_account_id', function( $value ){ | |
if ( function_exists('is_pos') && is_pos() ) { | |
return null; | |
} | |
return $value; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$customer_id = 6; // CHANGE THIS! | |
$customer_email = 'test@wordpress.com'; // CHANGE THIS! | |
$postids = $wpdb->get_col( | |
$wpdb->prepare( | |
" | |
SELECT pm.post_id | |
FROM {$wpdb->postmeta} pm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to your theme functions.php file | |
function woocommerce_pos_anr_verify_captcha_pre($response) { | |
if( function_exists('is_pos') && is_pos() ) { | |
return true; | |
} | |
return $response; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to your theme functions.php file | |
function pw_gift_card_product_response($response) { | |
if( ! function_exists('is_pos') || ! is_pos() ) | |
return $response; | |
$data = $response->get_data(); | |
$type = isset( $data['type'] ) ? $data['type'] : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// add to your theme functions.php file | |
function custom_product_response($response) { | |
if( ! function_exists('is_pos') || ! is_pos() ) | |
return $response; | |
$data = $response->get_data(); | |
$type = isset( $data['type'] ) ? $data['type'] : ''; |
NewerOlder