Skip to content

Commit 98e2ddf

Browse files
committed
fixed upsell plan details for bussines.
1 parent 89a6d70 commit 98e2ddf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

classes/Visualizer/Module/Sources.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
// +----------------------------------------------------------------------+
43
// | Copyright 2013 Madpixels (email : [email protected]) |
54
// +----------------------------------------------------------------------+
@@ -19,6 +18,7 @@
1918
// +----------------------------------------------------------------------+
2019
// | Author: Eugene Manuilov <[email protected]> |
2120
// +----------------------------------------------------------------------+
21+
2222
/**
2323
* Sources module class.
2424
*
@@ -52,10 +52,8 @@ class Visualizer_Module_Sources extends Visualizer_Module {
5252
*/
5353
public function __construct( Visualizer_Plugin $plugin ) {
5454
parent::__construct( $plugin );
55-
5655
$this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_SERIES, 'filterChartSeries', 1, 2 );
5756
$this->_addFilter( Visualizer_Plugin::FILTER_GET_CHART_DATA, 'filterChartData', 1, 2 );
58-
5957
$this->_addFilter( 'visualizer_pro_upsell', 'addProUpsell', 10, 2 );
6058
}
6159

@@ -97,7 +95,6 @@ private function _getSource( $chart_id ) {
9795
if ( ! class_exists( $class, true ) ) {
9896
return false;
9997
}
100-
10198
$this->_sources[ $chart_id ] = new $class();
10299
}
103100

@@ -135,11 +132,15 @@ public function filterChartData( $data, $chart_id ) {
135132
*/
136133
public function addProUpsell( $old, $feature = null ) {
137134
$return = '';
138-
if ( ! $feature || ($feature == 'schedule-chart' && ! apply_filters( 'visualizer_is_business', false )) ) {
135+
if ( ! $feature || ( $feature == 'schedule-chart' && ! apply_filters( 'visualizer_is_business', false ) ) ) {
136+
$plan = 'PRO';
137+
if ( $feature === 'schedule-chart' ) {
138+
$plan = 'BUSINESS';
139+
}
139140
$return = '<div class="only-pro-content">';
140141
$return .= ' <div class="only-pro-container">';
141142
$return .= ' <div class="only-pro-inner">';
142-
$return .= ' <p>' . __( 'Enable this feature in PRO version!', 'visualizer' ) . '</p>';
143+
$return .= ' <p>' . sprintf( __( 'Enable this feature in %s version!', 'visualizer' ), $plan ) . '</p>';
143144
$return .= ' <a target="_blank" href="' . Visualizer_Plugin::PRO_TEASER_URL . '" title="' . __( 'Buy now', 'visualizer' ) . '">' . __( 'Buy now', 'visualizer' ) . '</a>';
144145
$return .= ' </div>';
145146
$return .= ' </div>';
@@ -149,6 +150,7 @@ public function addProUpsell( $old, $feature = null ) {
149150
remove_filter( 'visualizer_pro_upsell', 'addProUpsell', 10, 1 );
150151
$return = '';
151152
}
153+
152154
return $return;
153155
}
154156

0 commit comments

Comments
 (0)