From fe22758ecc33608e7c78093cb2f58ce8aa92b8f4 Mon Sep 17 00:00:00 2001 From: Jason Coleman Date: Sun, 4 Nov 2018 19:57:21 -0500 Subject: [PATCH] fixing some issues if PMPro is deactivated --- includes/classes/class-pmpro-sws-landing-pages.php | 8 +++++++- includes/classes/class-pmpro-sws-reports.php | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/classes/class-pmpro-sws-landing-pages.php b/includes/classes/class-pmpro-sws-landing-pages.php index 3428b0f..ba8853a 100644 --- a/includes/classes/class-pmpro-sws-landing-pages.php +++ b/includes/classes/class-pmpro-sws-landing-pages.php @@ -199,7 +199,13 @@ public static function shortcode( $atts ) { $r .= ' '; } else { $landing_content = apply_filters( 'the_content', get_post_meta( $sitewide_sale->ID, 'pmpro_sws_sale_content', true ) ); - $template = pmpro_loadTemplate('checkout', 'local', 'pages'); + + if( function_exists( 'pmpro_loadTemplate' ) ) { + $template = pmpro_loadTemplate('checkout', 'local', 'pages'); + } else { + $template = ''; + } + $r .= '
'; $r .= $landing_content; $r .= '
'; diff --git a/includes/classes/class-pmpro-sws-reports.php b/includes/classes/class-pmpro-sws-reports.php index 2bf43ef..bea16bf 100644 --- a/includes/classes/class-pmpro-sws-reports.php +++ b/includes/classes/class-pmpro-sws-reports.php @@ -224,6 +224,10 @@ public static function enqueue_reports_js() { public static function enqueue_tracking_js() { global $pmpro_pages; + if( ! class_exists( 'MemberOrder' ) ) { + return; + } + $options = PMPro_SWS_Settings::get_options(); $active_sitewide_sale = $options['active_sitewide_sale_id']; wp_register_script( 'pmpro_sws_tracking', plugins_url( 'includes/js/pmpro-sws-tracking.js', PMPROSWS_BASENAME ), array( 'jquery', 'utils' ) );