diff --git a/includes/ECommerce.php b/includes/ECommerce.php index c1b23a26..bc83259d 100644 --- a/includes/ECommerce.php +++ b/includes/ECommerce.php @@ -89,6 +89,8 @@ public function __construct( Container $container ) { add_filter('woocommerce_shipping_fields', array( $this,'add_phone_number_email_to_shipping_form'), 10, 1 ); add_action('woocommerce_checkout_create_order', array( $this, 'save_custom_shipping_fields' ), 10, 1); add_action('woocommerce_admin_order_data_after_shipping_address', array( $this, 'display_custom_shipping_fields_in_admin' ), 10, 1 ); + add_action( 'before_woocommerce_init', array( $this,'custom_payment_gateways_order')); + add_action('before_woocommerce_init', array( $this,'dismiss_woo_payments_cta')); // Handle WonderCart Integrations if ( is_plugin_active( 'wonder-cart/init.php' ) ) { @@ -418,4 +420,20 @@ public function display_custom_shipping_fields_in_admin($order) { echo '
' . __('Email Address', 'wp_module_ecommerce') . ': ' . esc_html($shipping_email) . '
'; } } + + public function custom_payment_gateways_order() { + $array_data = array("pre_install_woocommerce_payments_promotion" => 2, + "yith_paypal_payments" => 0, + "element" => 1 + ); + update_option('woocommerce_gateway_order', $array_data); + } + + public function dismiss_woo_payments_cta() { + $is_dismissed = get_option( 'wcpay_welcome_page_incentives_dismissed'); + if (!is_array($is_dismissed) || empty($is_dismissed)) { + update_option('wcpay_welcome_page_incentives_dismissed', array("wcpay-promo-2023-action-discount")); + } + } + }