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 this to your theme's functions.php file. | |
*/ | |
function validate_pos_order_status($has_status, $order, $status ) { | |
if ( | |
$order->get_status() === 'pos-open' && // Must have 'pos-open' status. | |
$order->get_created_via() === 'woocommerce-pos' && // Must be created via POS. | |
$order->needs_payment() && // Must require payment. | |
$order->get_payment_method() === 'vipps' // Must use Vipps gateway. |
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 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(); |
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 this to your theme's functions.php file to display text on the PDF template. | |
* | |
* Options for positioning the text: | |
* - wpo_wcpdf_before_document | |
* - wpo_wcpdf_before_shop_address | |
* - wpo_wcpdf_after_shop_address | |
* - wpo_wcpdf_before_shop_logo |
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 this to your theme's functions.php file to save the bottle deposit on the order. | |
*/ | |
function woocommerce_pos_save_order( $order, $request, $creating ) { | |
global $WooCommerce_Bottle_Deposit; | |
if ( isset( $WooCommerce_Bottle_Deposit ) && class_exists( 'WooCommerce_Bottle_Deposit_Admin' ) ) { | |
$wc_bottle_deposit_admin = new WooCommerce_Bottle_Deposit_Admin( $WooCommerce_Bottle_Deposit->get_plugin_name(), $WooCommerce_Bottle_Deposit->get_version() ); | |
$wc_bottle_deposit_admin->handle_admin_orders( $order->get_id() ); |
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; | |
}); |
NewerOlder