Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
fixing some issues if PMPro is deactivated
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed Nov 5, 2018
1 parent 5d54ca5 commit fe22758
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/classes/class-pmpro-sws-landing-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ public static function shortcode( $atts ) {
$r .= '</div> <!-- .pmpro_sws_landing_content -->';
} 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 .= '<div class="pmpro_sws_landing_content pmpro_sws_landing_content_sale">';
$r .= $landing_content;
$r .= '</div> <!-- .pmpro_sws_landing_content -->';
Expand Down
4 changes: 4 additions & 0 deletions includes/classes/class-pmpro-sws-reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );
Expand Down

0 comments on commit fe22758

Please sign in to comment.