Skip to content

Commit

Permalink
Merge pull request #1170 from Codeinwp/feat/pro/475
Browse files Browse the repository at this point in the history
Updated current upsell links and buttons
  • Loading branch information
vytisbulkevicius authored Jul 16, 2024
2 parents 14d4e59 + af32d45 commit 701530b
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 8 deletions.
15 changes: 13 additions & 2 deletions classes/Visualizer/Module/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,58 +444,69 @@ public static function _getChartTypesLocalized( $enabledOnly = false, $get2Darra
'enabled' => $enabled,
// in ChartJS, the fill option is used to make Line chart an area: https://www.chartjs.org/docs/latest/charts/area.html
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/area-chart/',
),
'geo' => array(
'name' => esc_html__( 'Geo', 'visualizer' ),
'enabled' => $enabled,
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/geo-chart/',
),
'column' => array(
'name' => esc_html__( 'Column', 'visualizer' ),
'enabled' => $enabled,
'supports' => array( 'Google Charts', 'ChartJS' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/column-chart/',
),
'bubble' => array(
'name' => esc_html__( 'Bubble', 'visualizer' ),
'enabled' => $enabled,
// chartjs' bubble is ugly looking (and it won't work off the default bubble.csv) so it is being excluded for the time being.
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/bubble-chart/',
),
'scatter' => array(
'name' => esc_html__( 'Scatter', 'visualizer' ),
'enabled' => $enabled,
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/scatter-chart/',
),
'gauge' => array(
'name' => esc_html__( 'Gauge', 'visualizer' ),
'enabled' => $enabled,
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/gauge-chart/',
),
'candlestick' => array(
'name' => esc_html__( 'Candlestick', 'visualizer' ),
'enabled' => $enabled,
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/candlestick-chart/',
),
// pro types
'timeline' => array(
'name' => esc_html__( 'Timeline', 'visualizer' ),
'enabled' => false,
'supports' => array( 'Google Charts', 'ChartJS' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/timeline-chart/',
),
'combo' => array(
'name' => esc_html__( 'Combo', 'visualizer' ),
'enabled' => false,
'supports' => array( 'Google Charts' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/combo-chart/',
),
'polarArea' => array(
'name' => esc_html__( 'Polar Area', 'visualizer' ),
'enabled' => false,
'supports' => array( 'ChartJS' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/polar-area-chart/',
),
'radar' => array(
'name' => esc_html__( 'Radar/Spider', 'visualizer' ),
'enabled' => false,
'supports' => array( 'ChartJS' ),
'demo_url' => 'https://demo.themeisle.com/visualizer/radar-spider-chart/',
),
)
);
Expand Down Expand Up @@ -731,7 +742,7 @@ public function handleGetProSubMenu() {
font-weight: 600;
color: #fff;
}
#toplevel_page_visualizer ul.wp-submenu li:last-child > a {
#toplevel_page_visualizer ul.wp-submenu li:last-child > a > span {
color: #fff !important;
}
#toplevel_page_visualizer ul.wp-submenu li:last-child > a:hover {
Expand Down Expand Up @@ -1134,7 +1145,7 @@ public function getPluginMetaLinks( $plugin_meta, $plugin_file ) {
// flattr link
$plugin_meta[] = sprintf(
'<a style="color:red" href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'pluginrow' ) . '" target="_blank">%s</a>',
esc_html__( 'Pro Addon', 'visualizer' )
esc_html__( 'Get Visualizer Pro', 'visualizer' )
);
}

Expand Down
4 changes: 2 additions & 2 deletions classes/Visualizer/Render/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private function _renderSidebar() {
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( '6 more chart types', 'visualizer' );
} else {
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( '11 more chart types', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Manual Data Editor', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Synchronize Data Periodically', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'ChartJS Charts', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Table Google chart', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Frontend Actions(Print, Export, Copy, Download)', 'visualizer' ) . '</li>';
Expand All @@ -464,7 +464,7 @@ private function _renderSidebar() {
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'WPML support for translating charts', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Integration with Woocommerce Data endpoints', 'visualizer' ) . '</li>';
echo '<li><svg class="icon list-icon"><use xlink:href="#list-icon"></use></svg>' . __( 'Auto-sync with online files', 'visualizer' ) . '</li></ul>';
echo '<p><a href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarupsell' ) . '" target="_blank" class="button button-primary">' . __( 'View more features', 'visualizer' ) . '</a></p>';
echo '<p class="vz-sidebar-box-action"><a href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarMenuUpgrade', 'index' ) . '#pro-features" target="_blank" class="button button-secondary">' . __( 'View more features', 'visualizer' ) . '</a><a href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarMenuUpgrade', 'index' ) . '#pricing" target="_blank" class="button button-primary">' . __( 'Upgrade Now', 'visualizer' ) . '</a></p>';
echo '</div>';
echo '</div>';
echo '</div>';
Expand Down
8 changes: 6 additions & 2 deletions classes/Visualizer/Render/Page/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ protected function _renderContent() {
}
echo '<div class="type-box type-box-', $type, $lib_classes, '">';
if ( ! $array['enabled'] ) {
echo "<a class='pro-upsell' href='" . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'charttypes' ) . "' target='_blank'>";
$demo_url = isset( $array['demo_url'] ) ? $array['demo_url'] : '';
echo '<div class="pro-upsell">';
echo "<span class='visualizder-pro-label'>" . __( 'PREMIUM', 'visualizer' ) . '</span>';
echo '<div class="pro-upsell-overlay">';
echo '<div class="pro-upsell-action"><a href="' . esc_url( $demo_url ) . '" target="_blank" class="button button-secondary">' . __( 'View Demo', 'visualizer' ) . '</a><a href="' . tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'procharts', 'Addnewcharts' ) . '" target="_blank" class="button button-primary">' . __( 'Upgrade Now', 'visualizer' ) . '</a></div>';
echo '</div>';
}
echo '<label class="type-label', $type === $this->type ? ' type-label-selected' : '', '">';
echo '<span>' . $array['name'] . '</span>';
Expand All @@ -72,7 +76,7 @@ protected function _renderContent() {
}
echo '</label>';
if ( ! $array['enabled'] ) {
echo '</a>';
echo '</div>';
}
echo '</div>';
}
Expand Down
49 changes: 48 additions & 1 deletion css/frame.css
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ div.viz-group-content .viz-group-description {
height: 17px;
border: none;
color: #fff;
z-index: 1;
z-index: 4;
background: #c55555;
}

Expand Down Expand Up @@ -1633,3 +1633,50 @@ canvas.chartjs-render-monitor {
#vz-frontend-actions .only-pro-inner, #vz-data-controls .only-pro-inner {
text-align: center;
}

/******************************************************************************/
/******************************** chart type box upsell ***********************/
/******************************************************************************/

.pro-upsell .pro-upsell-overlay {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
display: grid;
place-items: center;
background-color: rgba(255, 255, 255, 0.7);
z-index: 1;
opacity: 0;
visibility: hidden;
transition: all .3s ease-in-out;
}
.pro-upsell:hover .pro-upsell-overlay{
opacity: 1;
visibility: visible;
}

.pro-upsell .pro-upsell-overlay .button {
width: 155px;
height: 39px;
background: #007CBA;
border-radius: 4px;
display: flex;
align-items: center;
text-align: center;
color: #FFFFFF;
justify-content: center;
}
.pro-upsell .pro-upsell-overlay .button.button-secondary{
background: #ffffff;
color: #007CBA;
}
.pro-upsell .pro-upsell-overlay .pro-upsell-action {
display: flex;
gap: 20px;
}
.pro-upsell .pro-upsell-overlay .pro-upsell-action .button{
width: 100%;
text-align: center;
}
13 changes: 13 additions & 0 deletions css/library.css
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@
color: #FFFFFF;
justify-content: center;
}
.visualizer-sidebar-box .button.button-secondary{
background: #ffffff;
color: #007CBA;
}
.visualizer-sidebar-box .we-offer{
background-color: transparent;
color: #007CBA;
Expand Down Expand Up @@ -382,6 +386,15 @@ input:checked + .visualizer-slider:before {
#visualizer-sidebar .visualizer-sidebar-box p {
margin-bottom: 0;
}
#visualizer-sidebar .visualizer-sidebar-box p.vz-sidebar-box-action {
display: flex;
gap: 20px;
margin-top: 25px;
}
#visualizer-sidebar .visualizer-sidebar-box p.vz-sidebar-box-action .button{
width: 100%;
text-align: center;
}
#visualizer-sidebar.one-columns {
border-top: 5px solid #007CBA;
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function() {
'location' => 'visualizer',
'has_upgrade_menu' => ! Visualizer_Module::is_pro(),
'upgrade_text' => esc_html__( 'Get Visualizer Pro', 'feedzy-rss-feeds' ),
'upgrade_link' => esc_url( tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarMenuUpgrade' ) ),
'upgrade_link' => esc_url( tsdk_utmify( Visualizer_Plugin::PRO_TEASER_URL, 'sidebarMenuUpgrade', 'index' ) ),
);
}
);
Expand Down

0 comments on commit 701530b

Please sign in to comment.