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
/** | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root | |
* directory of this source tree. | |
*/ | |
package ***CHANGE_ME***; | |
import android.content.Context; | |
import com.facebook.flipper.android.AndroidFlipperClient; |
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
declare module '@nozbe/watermelondb' { | |
import * as Q from '@nozbe/watermelondb/QueryDescription' | |
export { default as Collection } from '@nozbe/watermelondb/Collection' | |
export { default as Database } from '@nozbe/watermelondb/Database' | |
export { default as CollectionMap } from '@nozbe/watermelondb/Database/CollectionMap' | |
export { default as Relation } from '@nozbe/watermelondb/Relation' | |
export { default as Model, associations } from '@nozbe/watermelondb/Model' | |
export { default as Query } from '@nozbe/watermelondb/Query' | |
export { tableName, columnName, appSchema, tableSchema } from '@nozbe/watermelondb/Schema' |
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 | |
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; | |
} |
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 |
NewerOlder