Skip to content

Commit

Permalink
updated changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramyakrishnai committed Mar 11, 2024
1 parent 66d2f7c commit 93bda76
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion includes/ECommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function __construct( Container $container ) {
add_action( 'before_woocommerce_init', array( $this,'custom_payment_gateways_order'));
add_action('before_woocommerce_init', array( $this,'dismiss_woo_payments_cta'));
add_action( 'load-toplevel_page_'. $container->plugin()->id, array( $this, 'disable_creative_mail_banner' ) );
add_action( 'activated_plugin', array( $this, 'detect_plugin_activation' ), 10, 2 );

// Handle WonderCart Integrations
if ( is_plugin_active( 'wonder-cart/init.php' ) ) {
Expand Down Expand Up @@ -329,7 +330,6 @@ public function hide_woocommerce_set_up() {
// $woocommerce_list = array("setup");
update_option('woocommerce_task_list_hidden_lists', $woocommerce_list);
}

}

/**
Expand Down Expand Up @@ -443,5 +443,25 @@ public function disable_creative_mail_banner() {
update_option('ce4wp_ignore_review_notice', true);
}
}

/**
* Activates yith plugins (Paypal, Stripe) when woocommerce is activated
*
* @param string $plugin Path to the plugin file relative
* @param bool $network_activation enable the plugin for all sites
*
* @return void
*/
public function detect_plugin_activation( $plugin, $network_activation ) {
$plugin_slugs = array(
'nfd_slug_yith_paypal_payments_for_woocommerce',
'nfd_slug_yith_stripe_payments_for_woocommerce',
);
if ( 'woocommerce/woocommerce.php' === $plugin ) {
foreach ( $plugin_slugs as $plugin ) {
PluginInstaller::install( $plugin, true );
}
}
}

}

0 comments on commit 93bda76

Please sign in to comment.