Uname: Linux premium264.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.3.22 [ PHP INFO ] PHP os: Linux
Server Ip: 69.57.162.13
Your Ip: 216.73.216.219
User: workvvfb (1129) | Group: workvvfb (1084)
Safe Mode: OFF
Disable Function:
NONE

name : op-payment.php
<?php
function wc_openpos_offline_add_to_gateways( $gateways ) {
	if(class_exists('WC_Payment_Gateway'))
	{
		$gateways[] = 'OP_Gateway_Offline_Cash';
		$gateways[] = 'OP_Gateway_Offline_Multi';
	}
	return $gateways;
}
add_filter( 'woocommerce_payment_gateways', 'wc_openpos_offline_add_to_gateways' );
add_action( 'plugins_loaded', 'wc_openpos_offline_gateway_init', 11 );

function wc_openpos_offline_gateway_init() {
	if(class_exists('WC_Payment_Gateway'))
	{
		class OP_Gateway_Offline_Cash extends WC_Payment_Gateway {

			/**
			 * Constructor for the gateway.
			 */
			public function __construct() {
		  
				$this->id                 = 'cash';
				$this->icon               = '';
				$this->has_fields         = false;
				$this->method_title       = __( 'Cash', 'openpos' );
				$this->method_description = __( 'Cash method use for POS only.', 'openpos' );
			  
				// Load the settings.
				$this->init_form_fields();
				$this->init_settings();
			  
				// Define user set variables
				$this->title        = $this->method_title ;
				$this->description  = $this->method_description;
				$this->instructions = $this->method_description;
			  
			
			}
			public function is_available() {
				return false;
			}
		} 
		class OP_Gateway_Offline_Multi extends WC_Payment_Gateway {
	
			/**
			 * Constructor for the gateway.
			 */
			public function __construct() {
		  
				$this->id                 = 'pos_multi';
				$this->icon               = '';
				$this->has_fields         = false;
				$this->method_title       = __('Multi Methods','openpos');;
				$this->method_description = __( 'Multi payment method use for POS only.', 'openpos' );
			  
				// Load the settings.
				$this->init_form_fields();
				$this->init_settings();
			  
				// Define user set variables
				$this->title        = $this->method_title ;
				$this->description  = $this->method_description;
				$this->instructions = $this->method_description;
			}
			public function is_available() {
				return false;
			}
		}
	}
}
© 2025 GrazzMean