PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / trunk
WCPOS – Point of Sale (POS) plugin for WooCommerce vtrunk
1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 1.9.13 1.9.12 1.9.11 1.9.10 1.9.9 All 158 releases
woocommerce-pos / includes / Integrations / WePOS.php

WePOS.php in WCPOS – Point of Sale (POS) plugin for WooCommerce trunk, at includes/Integrations/WePOS.php

46 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WePOS.
4 *
5 * @package WCPOS\WooCommercePOS
6 */
7
8 namespace WCPOS\WooCommercePOS\Integrations;
9
10 use const WCPOS\WooCommercePOS\PLUGIN_FILE;
11
12 /**
13 * WePOS Integration.
14 *
15 * WePOS alters the WC REST API response for variable products, it includes the full list of variations
16 * instead of just the variation IDs. This breaks variations for WCPOS (and anyone else).
17 */
18 class WePOS {
19 /**
20 * Constructor.
21 */
22 public function __construct() {
23 add_action( 'admin_init', array( $this, 'check_conflict' ) );
24 }
25
26 /**
27 * Check for wePOS plugin conflict.
28 */
29 public function check_conflict(): void {
30 // Check if wePOS is active.
31 if ( is_plugin_active( 'wepos/wepos.php' ) ) {
32 deactivate_plugins( PLUGIN_FILE );
33 add_action( 'admin_notices', array( $this, 'render_conflict_notice' ) );
34 }
35 }
36
37 /**
38 * Render conflict admin notice.
39 */
40 public function render_conflict_notice(): void {
41 echo '<div class="notice notice-error is-dismissible">
42 <p>' . esc_html__( 'WCPOS cannot run alongside the wePOS plugin due to compatibility issues. WCPOS has been deactivated.', 'woocommerce-pos' ) . '</p>
43 </div>';
44 }
45 }
46