Commit 9ecdbe17 authored by Kenny Hall's avatar Kenny Hall

changed the name of product and calc in use classes to more accurately reflect...

changed the name of product and calc in use classes to more accurately reflect the question being asked. Added a check to see if Ninja Shop class exists.
parent 9e343a8e
Pipeline #1888 passed with stage
in 35 seconds
......@@ -93,7 +93,7 @@ class NF_PromotionManager
private function maybe_remove_ninja_shop()
{
if( ! $this->product_fields_in_use() && ! $this->calculations_in_use() ) {
if( ! $this->are_product_fields_in_use() && ! $this->are_calculations_in_use() || $this->is_ninja_shop_active() ) {
$this->remove_promotion( 'ninja-shop' );
}
}
......@@ -141,7 +141,7 @@ class NF_PromotionManager
/**
* Checks the DB to see if product fields are being used.
*/
private function product_fields_in_use()
private function are_product_fields_in_use()
{
global $wpdb;
......@@ -154,7 +154,7 @@ class NF_PromotionManager
return false;
}
private function calculations_in_use()
private function are_calculations_in_use()
{
global $wpdb;
......@@ -168,6 +168,14 @@ class NF_PromotionManager
return false;
}
private function is_ninja_shop_active()
{
if( class_exists( 'IT_Exchange', FALSE ) ) {
return true;
}
return false;
}
private function is_sendwp_active()
{
if( class_exists( '\\SendWP\\Mailer', FALSE ) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment