',
!empty( $col_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$col_classes ) ) . '"' : '',
!empty( $col_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$col_styles ) ) . ';"' : ''
);
// Column wrap - Filter html
$col_header_html = apply_filters( 'go_pricing_front_col_head_html',
$col_header_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_classes' => $col_classes,
'col_styles' => $col_styles
)
);
$html .= $col_header_html;
/**
* Signs
*/
// Reset
$sign_classes = array();
$sign_styles = array();
$sign_link_atts = array();
$sign_link_attributes = array();
$sign_span_styles = array();
$sign_html = '';
$sign_inner_html = '';
if ( !empty( $col_data['decoration']['col-sign'] ) && !empty( $col_data['decoration']['col-sign-type'] ) ) {
// Build classes & styles
if ( $col_data['decoration']['col-sign-type'] == 'text' ) {
$ribbon_data = $col_data['decoration']['col-sign']['text'];
$sign_classes[] = 'gw-go-ribbon-text';
if ( !empty( $ribbon_data['shadow'] ) ) $sign_classes[] = 'gw-go-ribbon-shadow';
$sign_span_styles[] = !empty( $ribbon_data['color'] ) ? sprintf( 'color:%s', $ribbon_data['color'] ) : '';
if ( !empty( $ribbon_data['bg-grad'] ) ) {
$sign_span_styles[] = !empty( $ribbon_data['bg-color'] ) || !empty( $ribbon_data['bg-color2'] ) ? sprintf( 'background-image:linear-gradient(%1$s, %2$s, %3$s)',
!empty( $ribbon_data['bg-grad-angle'] ) ? sprintf( '%ddeg', (int)$ribbon_data['bg-grad-angle'] ) : '0deg',
!empty( $ribbon_data['bg-color'] ) ? $ribbon_data['bg-color'] : 'transparent',
!empty( $ribbon_data['bg-color2'] ) ? $ribbon_data['bg-color2'] : 'transparent'
) : '';
}
$sign_span_styles[] = !empty( $ribbon_data['bg-color'] ) && empty( $ribbon_data['bg-grad'] ) ? sprintf( 'background-color:%s', $ribbon_data['bg-color'] ) : '';
if ( !empty( $ribbon_data['font-size'] ) && (int)$ribbon_data['font-size'] != 12 ) $sign_span_styles[] = sprintf( 'font-size:%spx !important' , (int)$ribbon_data['font-size'] );
if ( !empty( $ribbon_data['font-style']['bold'] ) ) $sign_span_styles[] = 'font-weight:bold !important';
if ( !empty( $ribbon_data['font-style']['italic'] ) ) $sign_span_styles[] = 'font-style:italic !important';
if ( !empty( $ribbon_data['font-style']['strikethrough'] ) ) $sign_span_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( !empty( $ribbon_data['font-family'] ) && $ribbon_data['font-family'] != $default_font ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $ribbon_data['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $ribbon_data['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $ribbon_data['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !empty( $font['value'] ) ) $sign_span_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
$sign_inner_html = sprintf( '
%2$s',
!empty( $sign_span_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$sign_span_styles ) ) . ';"' : '',
GW_GoPricing_Helper::esc_sprint( isset ( $col_data['decoration']['col-sign']['text']['content'] ) ? $col_data['decoration']['col-sign']['text']['content'] : '' )
);
} elseif ( $col_data['decoration']['col-sign-type'] == 'custom-img' ) {
if ( !empty( $col_data['decoration']['col-sign'][$col_data['decoration']['col-sign-type']]['data'] ) ) $sign_inner_html = sprintf( '

', esc_attr( $col_data['decoration']['col-sign'][$col_data['decoration']['col-sign-type']]['data'] ) );
} else {
foreach ( (array)$go_pricing['signs'][$col_data['decoration']['col-sign-type']] as $sign ) {
if ( !empty( $sign['group_name'] ) && !empty( $sign['group_data'] ) ) {
foreach ( (array)$sign['group_data'] as $sign_item ) {
if ( isset( $sign_item['value'] ) && $sign_item['value'] == $col_data['decoration']['col-sign'][$col_data['decoration']['col-sign-type']] ) $sign_inner_html = sprintf( '

', esc_attr( $sign_item['data'] ) );
}
} else {
if ( isset( $sign['value'] ) && $sign['value'] == $col_data['decoration']['col-sign'][$col_data['decoration']['col-sign-type']] ) $sign_inner_html = sprintf( '

', esc_attr( $sign['data'] ) );
}
}
}
if ( !empty( $col_data['decoration']['col-sign-align'] ) ) $sign_classes[] = $col_data['decoration']['col-sign-align'] == 'left' ? 'gw-go-ribbon-left' : 'gw-go-ribbon-right';
if ( !empty( $sign_inner_html ) && !empty( $col_data['decoration']['col-sign-link']['url'] ) ) {
if ( !empty( $col_data['decoration']['col-sign-link']['target'] ) ) $sign_link_atts[] = array( 'target', '_blank' );
if ( !empty( $col_data['decoration']['col-sign-link']['nofollow'] ) ) $sign_link_atts[] = array( 'rel', 'nofollow' );
$sign_link_atts = apply_filters( 'go_pricing_ribbion_link_button_atts',
$sign_link_atts,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index
)
);
foreach ( (array)$sign_link_atts as $sign_link_att ) {
if ( count( (array)$sign_link_att ) == 2 ) $sign_link_attributes[] = sprintf( '%1$s="%2$s"', $sign_link_att[0], esc_attr( $sign_link_att[1] ) );
}
$sign_inner_html = sprintf(
'
%3$s',
esc_attr( $col_data['decoration']['col-sign-link']['url'] ),
!empty( $sign_link_attributes ) ? ' ' . implode( ' ', (array)$sign_link_attributes ) : '',
$sign_inner_html
);
}
// Filter classes & styles
$sign_classes = apply_filters( 'go_pricing_front_sign_classes',
$sign_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index
)
);
if ( !empty( $col_data['decoration']['col-sign-position']['posx'] ) && !empty( $col_data['decoration']['col-sign-align'] ) )
$sign_styles[] = $col_data['decoration']['col-sign-align'] == 'left' ? sprintf( 'left:%dpx', (int)$col_data['decoration']['col-sign-position']['posx'] ) : sprintf( 'right:%dpx', (int)$col_data['decoration']['col-sign-position']['posx'] );
if ( !empty( $col_data['decoration']['col-sign-position']['posy'] ) ) $sign_styles[] = sprintf( 'top:%dpx', (int)$col_data['decoration']['col-sign-position']['posy'] );
$sign_styles = apply_filters( 'go_pricing_front_sign_styles',
$sign_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index
)
);
// Build html
$sign_html = sprintf(
'
%3$s
',
!empty( $sign_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$sign_classes ) ) . '"' : '',
!empty( $sign_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$sign_styles ) ) . ';"' : '',
!empty( $sign_inner_html ) ? $sign_inner_html : ''
);
// Filter html
$sign_html = apply_filters( 'go_pricing_front_sign_html',
$sign_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'sign_classes' => $sign_classes,
'sign_styles' => $sign_styles,
'sign_inner_html' => $sign_inner_html
)
);
}
/**
* Header
*/
// Reset
$header_classes = array();
$header_styles = array();
$header_custom_styles = array();
$price = '';
$payment = '';
$price_format = '';
$header_html = '';
$header_custom_html = '';
$templates = array();
if ( !empty( $column_style_data['type'] ) ) {
// Build classes, styles & price format
$header_classes[] = 'gw-go-header';
if ( !empty( $pricing_table['style'] ) && $pricing_table['style'] == 'clean' ) {
if ( !empty( $col_data['header']['style']['type'] ) && $col_data['header']['style']['type'] == 'standard' ) {
$header_classes[] = 'gw-go-header-standard';
} else {
$header_styles[] = 'text-shadow:none !important';
}
if ( !empty( $col_data['header']['style']['bg-img']['data'] ) && !empty( $column_style_data['type'] ) && $column_style_data['type'] == 'cpricing' ) {
$header_classes[] = 'gw-go-header-img';
$header_styles[] = sprintf( 'background-image:url(%s)', $col_data['header']['style']['bg-img']['data'] );
$header_styles[] = sprintf( 'background-position:%1$s%% %2$s%%',
isset( $col_data['header']['style']['bg-img']['posx'] ) ? (int)$col_data['header']['style']['bg-img']['posx'] : 50,
isset( $col_data['header']['style']['bg-img']['posy'] ) ? (int)$col_data['header']['style']['bg-img']['posy'] : 50
);
}
}
$general_settings = get_option( self::$plugin_prefix . '_table_settings' );
$price_format = !empty( $general_settings['currency'][0]['position'] ) && $general_settings['currency'][0]['position'] == 'left' ? '
%2$s%3$s' : '
%3$s%2$s';
// Filter classes, styles & price format
$header_classes = apply_filters( 'go_pricing_front_header_classes',
$header_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$header_styles = apply_filters( 'go_pricing_front_header_styles',
$header_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$price_format = apply_filters( 'go_pricing_front_price_format',
$price_format,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
// Build html
if ( !empty( $col_data['header']['general']['replace'] ) ) $column_style_data['type'] = 'html';
switch( $column_style_data['type'] ) {
case 'pricing' :
case 'cpricing' :
$price = '';
$payment = '';
$price_type = isset( $col_data['price']['type'] ) ? $col_data['price']['type'] : '';
switch( $price_type ) {
case 'price-html' :
$price = sprintf( '
%s', isset( $col_data['price']['price-html']['content'] ) ? $col_data['price']['price-html']['content'] : '' );
$payment = isset( $col_data['price']['payment']['content'] ) ? $col_data['price']['payment']['content'] : '';
break;
case 'price' :
$decimals = isset( $general_settings['currency'][0]['decimal-no'] ) ? (int)$general_settings['currency'][0]['decimal-no'] : 2;
$currency_symbol = '';
foreach ( (array)$go_pricing['currency'] as $currency ) {
if ( !empty( $currency['id'] ) && !empty( $currency['symbol'] ) && !empty( $general_settings['currency'][0]['currency'] ) && $currency['id'] == $general_settings['currency'][0]['currency'] ) $currency_symbol = $currency['symbol'];
}
if ( isset( $col_data['price']['price'][0]['amount'][0] ) && $col_data['price']['price'][0]['amount'][0] != '' ) {
if ( empty( $general_settings['currency'][0]['trailing-zero'] ) ) {
$dec = explode ( '.', (float)$col_data['price']['price'][0]['amount'][0] );
if ( !empty( $dec[1] ) ) {
if ( strlen( $dec[1] ) < $decimals ) $decimals = strlen( $dec[1] );
} else {
$decimals = 0;
}
}
$price = sprintf( $price_format,
isset( $general_settings['currency'][0] ) ? esc_attr( json_encode( $general_settings['currency'][0] ) ) : '',
$currency_symbol,
number_format(
(float)$col_data['price']['price'][0]['amount'][0],
$decimals,
isset( $general_settings['currency'][0]['decimal-sep'] ) ? $general_settings['currency'][0]['decimal-sep'] : '.',
isset( $general_settings['currency'][0]['thousand-sep'] ) ? $general_settings['currency'][0]['thousand-sep'] : ','
),
isset( $col_data['price']['price'][0]['amount'][0] ) ? number_format( (float)$col_data['price']['price'][0]['amount'][0], $decimals, '.', '' ) : 0
);
}
$payment = isset( $col_data['price']['price'][0]['name'] ) ? $col_data['price']['price'][0]['name'] : '';
break;
}
if ( !empty( $pricing_table['style'] ) && $pricing_table['style'] == 'clean' && !empty( $col_data['header']['style']['type'] ) && $col_data['header']['style']['type'] == 'standard' ) {
$header_template = '';
} else {
$header_template = '';
}
$header_custom_html = sprintf(
$header_template,
isset( $col_data['title']['title']['content'] ) ? $col_data['title']['title']['content'] : '',
isset( $price ) ? $price : '',
isset( $payment ) ? '
' . $payment . '' : ''
);
break;
case 'pricing2' :
case 'cpricing2' :
$price = '';
$payment = '';
$price_type = isset( $col_data['price']['type'] ) ? $col_data['price']['type'] : '';
switch( $price_type ) {
case 'price-html' :
$price = sprintf( '
%s', isset( $col_data['price']['price-html']['content'] ) ? $col_data['price']['price-html']['content'] : '' );
$payment = isset( $col_data['price']['payment']['content'] ) ? $col_data['price']['payment']['content'] : '';
break;
case 'price' :
$decimals = isset( $general_settings['currency'][0]['decimal-no'] ) ? (int)$general_settings['currency'][0]['decimal-no'] : 2;
$currency_symbol = '';
foreach ( (array)$go_pricing['currency'] as $currency ) {
if ( !empty( $currency['id'] ) && !empty( $currency['symbol'] ) && !empty( $general_settings['currency'][0]['currency'] ) && $currency['id'] == $general_settings['currency'][0]['currency'] ) $currency_symbol = $currency['symbol'];
}
if ( isset( $col_data['price']['price'][0]['amount'][0] ) && $col_data['price']['price'][0]['amount'][0] != '' ) {
if ( empty( $general_settings['currency'][0]['trailing-zero'] ) ) {
$dec = explode ( '.', (float)$col_data['price']['price'][0]['amount'][0] );
if ( !empty( $dec[1] ) ) {
if ( strlen( $dec[1] ) < $decimals ) $decimals = strlen( $dec[1] );
} else {
$decimals = 0;
}
}
$price = sprintf( $price_format,
isset( $general_settings['currency'][0] ) ? esc_attr( json_encode( $general_settings['currency'][0] ) ) : '',
$currency_symbol,
number_format(
(float)$col_data['price']['price'][0]['amount'][0],
$decimals,
isset( $general_settings['currency'][0]['decimal-sep'] ) ? $general_settings['currency'][0]['decimal-sep'] : '.',
isset( $general_settings['currency'][0]['thousand-sep'] ) ? $general_settings['currency'][0]['thousand-sep'] : ','
),
isset( $col_data['price']['price'][0]['amount'][0] ) ? number_format( (float)$col_data['price']['price'][0]['amount'][0], $decimals, '.', '' ) : 0
);
}
$payment = isset( $col_data['price']['price'][0]['name'] ) ? $col_data['price']['price'][0]['name'] : '';
break;
}
$header_custom_styles = !empty( $col_data['header']['general']['custom']['css'] ) ? explode( ';', preg_replace("/[\n\r]/","", trim( $col_data['header']['general']['custom']['css'], ' ;' ) ) ) : '';
foreach( (array)$header_custom_styles as $key => $header_custom_style ) {
if( !empty( $header_custom_styles[$key] ) ) $header_custom_styles[$key] = trim( $header_custom_style );
}
$header_custom_html = sprintf(
'',
isset( $col_data['title']['title']['content'] ) ? $col_data['title']['title']['content'] : '',
isset( $price ) ? $price : '',
isset( $payment ) ? '
' . $payment . '' : '',
isset( $col_data['header']['general']['custom']['html'] ) ? $col_data['header']['general']['custom']['html'] : '',
!empty( $header_custom_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$header_custom_styles ) ) . ';"' : ''
);
break;
case 'pricing3' :
case 'cpricing3' :
$price = '';
$payment = '';
$price_type = isset( $col_data['price']['type'] ) ? $col_data['price']['type'] : '';
switch( $price_type ) {
case 'price-html' :
$price = sprintf( '
%s', isset( $col_data['price']['price-html']['content'] ) ? $col_data['price']['price-html']['content'] : '' );
$payment = isset( $col_data['price']['payment']['content'] ) ? $col_data['price']['payment']['content'] : '';
break;
case 'price' :
$decimals = isset( $general_settings['currency'][0]['decimal-no'] ) ? (int)$general_settings['currency'][0]['decimal-no'] : 2;
$currency_symbol = '';
foreach ( (array)$go_pricing['currency'] as $currency ) {
if ( !empty( $currency['id'] ) && !empty( $currency['symbol'] ) && !empty( $general_settings['currency'][0]['currency'] ) && $currency['id'] == $general_settings['currency'][0]['currency'] ) $currency_symbol = $currency['symbol'];
}
if ( isset( $col_data['price']['price'][0]['amount'][0] ) && $col_data['price']['price'][0]['amount'][0] != '' ) {
if ( empty( $general_settings['currency'][0]['trailing-zero'] ) ) {
$dec = explode ( '.', (float)$col_data['price']['price'][0]['amount'][0] );
if ( !empty( $dec[1] ) ) {
if ( strlen( $dec[1] ) < $decimals ) $decimals = strlen( $dec[1] );
} else {
$decimals = 0;
}
}
$price = sprintf( $price_format,
isset( $general_settings['currency'][0] ) ? esc_attr( json_encode( $general_settings['currency'][0] ) ) : '',
$currency_symbol,
number_format(
(float)$col_data['price']['price'][0]['amount'][0],
$decimals,
isset( $general_settings['currency'][0]['decimal-sep'] ) ? $general_settings['currency'][0]['decimal-sep'] : '.',
isset( $general_settings['currency'][0]['thousand-sep'] ) ? $general_settings['currency'][0]['thousand-sep'] : ','
),
isset( $col_data['price']['price'][0]['amount'][0] ) ? number_format( (float)$col_data['price']['price'][0]['amount'][0], $decimals, '.', '' ) : 0
);
}
$payment = isset( $col_data['price']['price'][0]['name'] ) ? $col_data['price']['price'][0]['name'] : '';
break;
}
$header_custom_styles = !empty( $col_data['header']['general']['custom']['css'] ) ? explode( ';', preg_replace("/[\n\r]/","", trim( $col_data['header']['general']['custom']['css'], ' ;' ) ) ) : '';
foreach( (array)$header_custom_styles as $key => $header_custom_style ) {
if( !empty( $header_custom_styles[$key] ) ) $header_custom_styles[$key] = trim( $header_custom_style );
}
$header_custom_html = sprintf(
'
%1$s
',
isset( $col_data['title']['title']['content'] ) ? $col_data['title']['title']['content'] : '',
isset( $price ) ? $price : '',
isset( $payment ) ? '
' . $payment . '' : '',
!empty( $col_data['header']['general']['custom']['img']['data'] ) ?
sprintf(
'

',
$col_data['header']['general']['custom']['img']['data'],
isset( $col_data['header']['general']['custom']['img']['responsive'] ) ? ' class="gw-go-responsive-img"' : '',
isset( $col_data['header']['general']['custom']['img']['alt'] ) ? ' alt="' . esc_attr( $col_data['header']['general']['custom']['img']['alt'] ) . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['width'] ) ? ' width="' . (int)$col_data['header']['general']['custom']['img']['width'] . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['height'] ) ? ' height="' . (int)$col_data['header']['general']['custom']['img']['height'] . '"' : ''
)
: '',
!empty( $header_custom_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$header_custom_styles ) ) . ';"' : ''
);
break;
case 'product' :
case 'cproduct' :
$price = '';
$payment = '';
$price_type = isset( $col_data['price']['type'] ) ? $col_data['price']['type'] : '';
switch( $price_type ) {
case 'price-html' :
$price = sprintf( '
%s', isset( $col_data['price']['price-html']['content'] ) ? $col_data['price']['price-html']['content'] : '' );
$payment = isset( $col_data['price']['payment']['content'] ) ? $col_data['price']['payment']['content'] : '';
break;
case 'price' :
$decimals = isset( $general_settings['currency'][0]['decimal-no'] ) ? (int)$general_settings['currency'][0]['decimal-no'] : 2;
$currency_symbol = '';
foreach ( (array)$go_pricing['currency'] as $currency ) {
if ( !empty( $currency['id'] ) && !empty( $currency['symbol'] ) && !empty( $general_settings['currency'][0]['currency'] ) && $currency['id'] == $general_settings['currency'][0]['currency'] ) $currency_symbol = $currency['symbol'];
}
if ( isset( $col_data['price']['price'][0]['amount'][0] ) && $col_data['price']['price'][0]['amount'][0] != '' ) {
if ( empty( $general_settings['currency'][0]['trailing-zero'] ) ) {
$dec = explode ( '.', (float)$col_data['price']['price'][0]['amount'][0] );
if ( !empty( $dec[1] ) ) {
if ( strlen( $dec[1] ) < $decimals ) $decimals = strlen( $dec[1] );
} else {
$decimals = 0;
}
}
$price = sprintf( $price_format,
isset( $general_settings['currency'][0] ) ? esc_attr( json_encode( $general_settings['currency'][0] ) ) : '',
$currency_symbol,
number_format(
(float)$col_data['price']['price'][0]['amount'][0],
$decimals,
isset( $general_settings['currency'][0]['decimal-sep'] ) ? $general_settings['currency'][0]['decimal-sep'] : '.',
isset( $general_settings['currency'][0]['thousand-sep'] ) ? $general_settings['currency'][0]['thousand-sep'] : ','
),
isset( $col_data['price']['price'][0]['amount'][0] ) ? number_format( (float)$col_data['price']['price'][0]['amount'][0], $decimals, '.', '' ) : 0
);
}
$payment = isset( $col_data['price']['price'][0]['name'] ) ? $col_data['price']['price'][0]['name'] : '';
break;
}
$header_custom_styles = !empty( $col_data['header']['general']['custom']['css'] ) ? explode( ';', preg_replace("/[\n\r]/","", trim( $col_data['header']['general']['custom']['css'], ' ;' ) ) ) : '';
$header_custom_html = sprintf(
'
%1$s
%3$s%4$s',
isset( $col_data['title']['title']['content'] ) ? $col_data['title']['title']['content'] : '',
!empty( $col_data['header']['general']['custom']['img']['data'] ) ?
sprintf(
'

',
$col_data['header']['general']['custom']['img']['data'],
isset( $col_data['header']['general']['custom']['img']['responsive'] ) ? ' class="gw-go-responsive-img"' : '',
isset( $col_data['header']['general']['custom']['img']['alt'] ) ? ' alt="' . esc_attr( $col_data['header']['general']['custom']['img']['alt'] ) . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['width'] ) ? ' width="' . (int)$col_data['header']['general']['custom']['img']['width'] . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['height'] ) ? ' height="' . (int)$col_data['header']['general']['custom']['img']['height'] . '"' : ''
)
: '',
isset( $payment ) ? '
' . $payment . '' : '',
isset( $price ) ? '
' . $price . '
' : ''
);
break;
case 'team' :
case 'cteam' :
$header_custom_styles = !empty( $col_data['header']['general']['custom']['css'] ) ? explode( ';', preg_replace("/[\n\r]/","", trim( $col_data['header']['general']['custom']['css'], ' ;' ) ) ) : '';
$header_custom_html = sprintf(
'
%1$s%2$s
',
isset( $col_data['title']['title']['content'] ) ? $col_data['title']['title']['content'] : '',
isset( $col_data['title']['subtitle']['content'] ) ? sprintf( '
%s', $col_data['title']['subtitle']['content'] ) : '',
!empty( $col_data['header']['general']['custom']['img']['data'] ) ?
sprintf(
'

',
$col_data['header']['general']['custom']['img']['data'],
isset( $col_data['header']['general']['custom']['img']['responsive'] ) ? ' class="gw-go-responsive-img"' : '',
isset( $col_data['header']['general']['custom']['img']['alt'] ) ? ' alt="' . esc_attr( $col_data['header']['general']['custom']['img']['alt'] ) . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['width'] ) ? ' width="' . (int)$col_data['header']['general']['custom']['img']['width'] . '"' : '',
!empty( $col_data['header']['general']['custom']['img']['height'] ) ? ' height="' . (int)$col_data['header']['general']['custom']['img']['height'] . '"' : ''
)
: ''
);
break;
case 'html' :
case 'chtml' :
$header_styles = !empty( $col_data['header']['general']['css'] ) ? explode( ';', preg_replace("/[\n\r]/","", trim( $col_data['header']['general']['css'], ' ;' ) ) ) : '';
foreach( (array)$header_styles as $key => $header_style ) {
if( !empty($header_styles[$key] ) ) $header_styles[$key] = trim( $header_style );
}
$header_custom_html = isset( $col_data['header']['general']['html'] ) ? $col_data['header']['general']['html'] : '';
break;
}
}
$header_html = sprintf(
$sign_html . '
%3$s
',
!empty( $header_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$header_classes ) ) . '"' : '',
!empty( $header_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$header_styles ) ) . ';"' : '',
$header_custom_html
);
// Filter html
$header_html = apply_filters( 'go_pricing_front_header_html',
$header_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'header_classes' => $header_classes,
'header_styles' => $header_styles,
'header_custom_styles' => $header_custom_styles,
'header_custom_html' => $header_custom_html,
'price_format' => $price_format,
'price' => $price
)
);
$table_data = $pricing_table;
if ( isset( $table_data['col-data'] ) ) unset( $table_data['col-data'] );
$header_data = apply_filters(
"go_pricing_front_header_html_{$pricing_table['style']}",
$header_html,
array(
'table_data' => $table_data,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'col_data' => $col_data,
'sign_html' => $sign_html,
'default_font' => $default_font,
'google_fonts' => $google_fonts
)
);
$header_html = is_array( $header_data ) && !empty( $header_data['html'] ) ? $header_data['html'] : $header_html;
if ( is_array( $header_data ) && !empty( $header_data['css'] ) ) $custom_inline_styles = array_merge( $custom_inline_styles, $header_data['css'] );
if ( is_array( $header_data ) && !empty( $header_data['google_fonts'] ) ) $google_fonts = $header_data['google_fonts'];
$html .= $header_html;
/**
* Body
*/
// Reset
$body_classes = array();
$body_styles = array();
$body_html = '';
$body_rows_html = '';
if ( isset( $pricing_table['col-data'][$col_index]['body-row'] ) ) {
foreach ( (array)$pricing_table['col-data'][$col_index]['body-row'] as $body_row_index => $body_row_data ) {
if ( is_string( $body_row_data ) ) $body_row_data = GW_GoPricing_Helper::parse_data( $body_row_data );
// Tooltip
// Reset
$tooltip_classes = array();
$tooltip_styles = array();
$tooltip_html = '';
// Build classes & styles
$tooltip_classes[] = "gw-go-tooltip-content";
if ( isset( $pricing_table['tooltip']['width'] ) ) $tooltip_styles[] = sprintf( 'width:%dpx', (int)$pricing_table['tooltip']['width'] );
if ( !empty( $pricing_table['tooltip']['text-color'] ) ) $tooltip_styles[] = 'color:' . $pricing_table['tooltip']['text-color'];
if ( !empty( $pricing_table['tooltip']['bg-color'] ) ) $tooltip_styles[] = 'background-color:' . $pricing_table['tooltip']['bg-color'];
if ( !empty( $pricing_table['tooltip']['bg-color'] ) ) $tooltip_styles[] = 'border-color:' . $pricing_table['tooltip']['bg-color'];
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-size'] ) ) $tooltip_styles[] = sprintf( 'font-size:%spx !important' , (int)$body_row_data[$body_row_data['type']]['tooltip']['font-size'] );
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['line-height'] ) ) $tooltip_styles[] = sprintf( 'line-height:%spx !important' , (int)$body_row_data[$body_row_data['type']]['tooltip']['line-height'] );
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-style']['bold'] ) ) $tooltip_styles[] = 'font-weight:bold !important';
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-style']['italic'] ) ) $tooltip_styles[] = 'font-style:italic !important';
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-style']['strikethrough'] ) ) $tooltip_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( isset( $body_row_data['type'] ) && !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-family'] ) ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $body_row_data[$body_row_data['type']]['tooltip']['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $body_row_data[$body_row_data['type']]['tooltip']['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !empty( $font['value'] ) ) $tooltip_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
// Filter classes & styles
$tooltip_classes = apply_filters( 'go_pricing_front_row_tooltip_classes',
$tooltip_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
)
);
$tooltip_styles = apply_filters( 'go_pricing_front_row_tooltip_styles',
$tooltip_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
)
);
// Build html
$tooltip_html = isset( $body_row_data['type'] ) && isset( $body_row_data[$body_row_data['type']]['tooltip']['content'] ) && $body_row_data[$body_row_data['type']]['tooltip']['content'] != '' ?
sprintf(
'
%3$s
',
!empty( $tooltip_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$tooltip_classes ) ) . '"' : '',
!empty( $tooltip_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$tooltip_styles ) ) . ';"' : '',
$body_row_data[$body_row_data['type']]['tooltip']['content']
) : '';
// Filter html
$tooltip_html = apply_filters( 'go_pricing_front_row_tooltip_html',
$tooltip_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
'tooltip_classes' => $tooltip_classes,
'tooltip_styles' => $tooltip_styles,
)
);
if ( !isset( $body_row_data['type'] ) ) { $body_row_data['type'] = 'html'; }
if ( !empty( $body_row_data['type'] ) ) {
// Row
// Reset
$body_row_classes = array();
$body_row_styles = array();
$body_row_inline_styles = array();
$body_row_html = '';
// Build styles & classes
if ( $body_row_index % 2 == 1 ) { $body_row_classes[] = 'gw-go-even'; }
if ( !empty( $body_row_data['row-align'] ) ) {
if ( $body_row_data['type'] == 'button' ) $body_row_data['row-align'] = 'center';
$body_row_styles[] = 'text-align:' . $body_row_data['row-align'];
}
// Row inline styles
if ( $body_row_data['type'] == 'html' ) {
if ( !empty( $body_row_data['html']['font-size'] ) ) $body_row_inline_styles[] = sprintf( 'font-size:%spx !important' , (int)$body_row_data['html']['font-size'] );
if ( !empty( $body_row_data['html']['line-height'] ) ) $body_row_inline_styles[] = sprintf( 'line-height:%spx !important' , (int)$body_row_data['html']['line-height'] );
if ( !empty( $body_row_data['html']['text-align'] ) ) $body_row_inline_styles[] = sprintf( 'text-align:%s !important' , $body_row_data['html']['text-align'] );
if ( !empty( $body_row_data['html']['font-style']['bold'] ) ) $body_row_inline_styles[] = 'font-weight:bold !important';
if ( !empty( $body_row_data['html']['font-style']['italic'] ) ) $body_row_inline_styles[] = 'font-style:italic !important';
if ( !empty( $body_row_data['html']['font-style']['strikethrough'] ) ) $body_row_inline_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( !empty( $body_row_data['html']['font-family'] ) && $body_row_data['html']['font-family'] != $default_font ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $body_row_data['html']['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $body_row_data['html']['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $body_row_data['html']['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !empty( $font['value'] ) ) $body_row_inline_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
}
if ( $body_row_data['type'] == 'button' ) {
if ( !empty( $body_row_data['button']['font-size'] ) ) $body_row_inline_styles[] = sprintf( 'font-size:%spx !important' , (int)$body_row_data['button']['font-size'] );
if ( !empty( $body_row_data['button']['font-style']['bold'] ) ) $body_row_inline_styles[] = 'font-weight:bold !important';
if ( !empty( $body_row_data['button']['font-style']['italic'] ) ) $body_row_inline_styles[] = 'font-style:italic !important';
if ( !empty( $body_row_data['button']['font-style']['strikethrough'] ) ) $body_row_inline_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( !empty( $body_row_data['button']['font-family'] ) && $body_row_data['button']['font-family'] != $default_font ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $body_row_data['button']['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $body_row_data['button']['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $body_row_data['button']['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !empty( $font['value'] ) ) $body_row_inline_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
}
if ( !empty( $body_row_inline_styles ) ) {
$custom_inline_styles[] = sprintf(
'.gw-go-col-wrap-%1$s .gw-go-body li[data-row-index="%2$s"] %4$s{ %3$s; }',
$col_index,
$body_row_index,
implode( '; ', (array)$body_row_inline_styles ),
isset( $body_row_data['type'] ) && $body_row_data['type'] == 'button' ? '.gw-go-btn ' : ''
);
}
// Filter classes & styles
$body_row_classes = apply_filters( 'go_pricing_front_row_classes',
$body_row_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
)
);
$body_row_styles = apply_filters( 'go_pricing_front_row_styles',
$body_row_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
)
);
$body_row_inline_styles = apply_filters(
"go_pricing_front_body_row_styles_{$pricing_table['style']}",
array(),
array(
'col_index' => $col_index,
'row_index' => $body_row_index,
'row_data' => $body_row_data
)
);
if ( !empty( $body_row_inline_styles ) && is_array( $body_row_inline_styles ) ) $custom_inline_styles = array_merge( $custom_inline_styles, $body_row_inline_styles );
// Build html
// Row content
$body_row_inner_content = '';
switch( $body_row_data['type'] ) {
case 'html' :
$body_row_inner_content = isset( $body_row_data[$body_row_data['type']]['content'] ) ? $body_row_data[$body_row_data['type']]['content'] . $tooltip_html : '';
break;
case 'button' :
$button_data = !empty( $body_row_data['button'] ) ? $body_row_data['button'] : array();
$button_css = array();
$button_wrap_classes = array();
$button_classes = array();
$button_atts = array();
$button_attributes = array();
$button_wrap_classes[] = 'gw-go-btn-wrap';
$button_classes[] = 'gw-go-btn';
if ( !empty( $body_row_data[$body_row_data['type']]['size'] ) ) $button_classes[] = 'gw-go-btn-' . $body_row_data[$body_row_data['type']]['size'];
if ( !empty( $body_row_data[$body_row_data['type']]['target'] ) ) $button_atts[] = array( 'target', '_blank' );
if ( !empty( $body_row_data[$body_row_data['type']]['nofollow'] ) ) $button_atts[] = array( 'rel', 'nofollow' );
if ( $current_style == 'clean' ) {
if ( !empty( $button_data['bg-color'] ) ) $button_css['normal'][] = sprintf( 'background-color:%s !important', $button_data['bg-color'] );
if ( !empty( $button_data['color'] ) ) $button_css['normal'][] = sprintf( 'color:%s !important', $button_data['color'] );
if ( !empty( $button_css['normal'] ) ) $custom_inline_styles[] = sprintf( '.gw-go-col-wrap-%1$s .gw-go-body li[data-row-index="%2$s"] .gw-go-btn { %3$s; }',
$col_index,
$body_row_index,
!empty( $button_css['normal'] ) ? implode( '; ', $button_css['normal'] ) : ''
);
if ( !empty( $button_data['bg-color-hover'] ) ) $button_css['hover'][] = sprintf( 'background-color:%s !important', $button_data['bg-color-hover'] );
if ( !empty( $button_data['color-hover'] ) ) $button_css['hover'][] = sprintf( 'color:%s !important', $button_data['color-hover'] );
if ( !empty( $button_css['hover'] ) ) $custom_inline_styles[] = sprintf( '.gw-go-hover.gw-go-col-wrap-%1$s .gw-go-body li[data-row-index="%2$s"] .gw-go-btn { %3$s; }',
$col_index,
$body_row_index,
!empty( $button_css['hover'] ) ? implode( '; ', $button_css['hover'] ) : ''
);
}
// Filter classes & atts
$button_classes = apply_filters( "go_pricing_front_body_button_classes_{$pricing_table['style']}",
$button_classes,
array(
'col_index' => $col_index,
'row_index' => $body_row_index,
'row_data' => $body_row_data
)
);
$button_atts = apply_filters( 'go_pricing_front_body_button_atts',
$button_atts,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
foreach ( (array)$button_atts as $button_att ) {
if ( count( (array)$button_att ) == 2 ) $button_attributes[] = sprintf( '%1$s="%2$s"', $button_att[0], esc_attr( $button_att[1] ) );
}
// Build button html
if ( !empty( $body_row_data[$body_row_data['type']]['type'] ) ) {
switch( $body_row_data[$body_row_data['type']]['type'] ) {
case 'button' :
$button_html = isset( $body_row_data[$body_row_data['type']]['code'] ) && $body_row_data[$body_row_data['type']]['code'] != '' && isset( $body_row_data[$body_row_data['type']]['content'] ) && $body_row_data[$body_row_data['type']]['content'] != '' ?
sprintf(
'
%4$s',
esc_attr( $body_row_data[$body_row_data['type']]['code'] ),
!empty( $button_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$button_classes ) ) . '"' : '',
!empty( $button_attributes ) ? ' ' . implode( ' ', (array)$button_attributes ) : '',
$body_row_data[$body_row_data['type']]['content']
) : '';
break;
case 'submit' :
$button_html = isset( $body_row_data[$body_row_data['type']]['code'] ) && $body_row_data[$body_row_data['type']]['code'] != '' && isset( $body_row_data[$body_row_data['type']]['content'] ) && $body_row_data[$body_row_data['type']]['content'] != '' ?
sprintf(
'
%2$s%3$s',
!empty( $button_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$button_classes ) ) . '"' : '',
$body_row_data[$body_row_data['type']]['content'],
$body_row_data[$body_row_data['type']]['code']
) : '';
break;
case 'custom' :
$button_html = isset( $body_row_data[$body_row_data['type']]['code'] ) ? $body_row_data[$body_row_data['type']]['code'] : '';
break;
}
}
// Filter footer html
$button_html = apply_filters( 'go_pricing_front_body_button_html',
$button_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
'button_classes' => $button_classes,
'button_atts' => $button_atts,
'button_attributes' => $button_attributes
)
);
$body_row_inner_content = $button_html;
}
$body_row_html = isset( $body_row_data ) ?
sprintf(
'
%3$s
',
!empty( $body_row_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$body_row_classes ) ) . '"' : '',
!empty( $body_row_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$body_row_styles ) ) . ';"' : '',
$body_row_inner_content
) : '';
// Filter html
$body_row_html = apply_filters( 'go_pricing_front_body_row_html',
$body_row_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $body_row_index,
'row_classes' => $body_row_classes,
'row_styles' => $body_row_styles,
)
);
$body_rows_html .= $body_row_html;
}
}
}
// Body
// Build classes & styles
$body_classes[] = "gw-go-body";
// Filter classes & styles
$body_classes = apply_filters( 'go_pricing_front_body_classes',
$body_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$body_styles = apply_filters( 'go_pricing_front_body_styles',
$body_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
// Build html
$body_html = !empty( $body_rows_html ) ?
sprintf(
'
',
!empty( $body_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$body_classes ) ) . '"' : '',
!empty( $body_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$body_styles ) ) . ';"' : '',
$body_rows_html
) : '';
// Filter html
$body_html = apply_filters( 'go_pricing_front_body_html',
$body_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'body_rows_html' => $body_rows_html,
'body_classes' => $body_classes,
'body_styles' => $body_styles
)
);
$html .= $body_html;
/**
* footer
*/
// Reset
$footer_classes = array();
$footer_styles = array();
$footer_html = '';
$footer_rows_html = '';
if ( empty( $pricing_table['hide-footer'] ) && !empty( $pricing_table['col-data'][$col_index]['footer-row'] ) ) {
foreach ( (array)$pricing_table['col-data'][$col_index]['footer-row'] as $footer_row_index => $footer_row_data ) {
if ( is_string( $footer_row_data ) ) $footer_row_data = GW_GoPricing_Helper::parse_data( $footer_row_data );
// Tooltip
// Reset
$tooltip_classes = array();
$tooltip_styles = array();
$tooltip_html = '';
// Build classes & styles
$tooltip_classes[] = "gw-go-tooltip";
if ( isset( $pricing_table['tooltip-width'] ) ) $tooltip_styles[] = 'width:' . $pricing_table['tooltip-width'];
if ( !empty( $pricing_table['tooltip-text-color'] ) ) $tooltip_styles[] = 'color:' . $pricing_table['tooltip-text-color'];
if ( !empty( $pricing_table['tooltip-bg-color'] ) ) $tooltip_styles[] = 'background-color:' . $pricing_table['tooltip-bg-color'];
if ( !empty( $pricing_table['tooltip-bg-color'] ) ) $tooltip_styles[] = 'border-color:' . $pricing_table['tooltip-bg-color'];
// Filter classes & styles
$tooltip_classes = apply_filters( 'go_pricing_front_row_tooltip_classes',
$tooltip_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $footer_row_index,
)
);
$tooltip_styles = apply_filters( 'go_pricing_front_row_tooltip_styles',
$tooltip_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $footer_row_index,
)
);
// Build html
$tooltip_html = isset( $footer_row_data['row-tooltip'] ) && $footer_row_data['row-tooltip'] != '' ?
sprintf(
'
%3$s
',
!empty( $tooltip_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$tooltip_classes ) ) . '"' : '',
!empty( $tooltip_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$tooltip_styles ) ) . ';"' : '',
$footer_row_data['row-tooltip']
) : '';
// Filter html
$tooltip_html = apply_filters( 'go_pricing_front_row_tooltip_html',
$tooltip_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $footer_row_index,
'tooltip_classes' => $tooltip_classes,
'tooltip_styles' => $tooltip_styles,
)
);
if ( !isset( $footer_row_data['type'] ) ) { $footer_row_data['type'] = 'button'; }
if ( !empty( $footer_row_data['type'] ) ) {
// Row
// Reset
$footer_row_classes = array();
$footer_row_styles = array();
$footer_row_inline_styles = array();
$footer_row_html = '';
// Build styles & classes
$footer_row_classes[] = 'gw-go-footer-row';
if ( $footer_row_index % 2 == 1 ) { $footer_row_classes[] = 'gw-go-even'; }
if ( !empty( $footer_row_data['row-align'] ) ) {
if ( $footer_row_data['type'] == 'button' ) $footer_row_data['row-align'] = 'center';
$footer_row_styles[] = 'text-align:' . $footer_row_data['row-align'];
}
// Row inline styles
if ( $footer_row_data['type'] == 'html' ) {
if ( !empty( $footer_row_data['html']['font-size'] ) ) $footer_row_inline_styles[] = sprintf( 'font-size:%spx !important' , (int)$footer_row_data['html']['font-size'] );
if ( !empty( $footer_row_data['html']['line-height'] ) ) $footer_row_inline_styles[] = sprintf( 'line-height:%spx !important' , (int)$footer_row_data['html']['line-height'] );
if ( !empty( $footer_row_data['html']['text-align'] ) ) $footer_row_inline_styles[] = sprintf( 'text-align:%s !important' , $footer_row_data['html']['text-align'] );
if ( !empty( $footer_row_data['html']['font-style']['bold'] ) ) $footer_row_inline_styles[] = 'font-weight:bold !important';
if ( !empty( $footer_row_data['html']['font-style']['italic'] ) ) $footer_row_inline_styles[] = 'font-style:italic !important';
if ( !empty( $footer_row_data['html']['font-style']['strikethrough'] ) ) $footer_row_inline_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( !empty( $footer_row_data['html']['font-family'] ) && $footer_row_data['html']['font-family'] != $default_font ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $footer_row_data['html']['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $footer_row_data['html']['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $footer_row_data['html']['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
if ( !empty( $font['value'] ) ) $footer_row_inline_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
}
if ( $footer_row_data['type'] == 'button' ) {
if ( !empty( $footer_row_data['button']['font-size'] ) ) $footer_row_inline_styles[] = sprintf( 'font-size:%spx !important' , (int)$footer_row_data['button']['font-size'] );
if ( !empty( $footer_row_data['button']['font-style']['bold'] ) ) $footer_row_inline_styles[] = 'font-weight:bold !important';
if ( !empty( $footer_row_data['button']['font-style']['italic'] ) ) $footer_row_inline_styles[] = 'font-style:italic !important';
if ( !empty( $footer_row_data['button']['font-style']['strikethrough'] ) ) $footer_row_inline_styles[] = 'text-decoration:line-through !important';
$google_font = '';
if ( !empty( $footer_row_data['button']['font-family'] ) && $footer_row_data['button']['font-family'] != $default_font ) {
foreach( (array)$go_pricing['fonts'] as $fonts ) {
if ( !empty( $fonts['group_name'] ) && !empty( $fonts['group_data'] ) ) {
foreach( (array)$fonts['group_data'] as $font ) {
if ( !empty( $font['value'] ) && $font['value'] == $footer_row_data['button']['font-family'] ) {
if ( !empty( $font['name'] ) && !empty( $font['url'] ) ) {
$font_url_params = array();
/* Google Font */
if ( preg_match( '/fonts.googleapis.com/', $font['url'] ) ) {
$font_url_params[] = '400';
if ( !empty( $footer_row_data['button']['font-style']['bold'] ) ) $font_url_params[] = 'b';
if ( !empty( $footer_row_data['button']['font-style']['italic'] ) ) $font_url_params[] = 'i';
$font['url'] .= sprintf( ':%s', implode( ',', $font_url_params ) );
}
}
if ( !empty( $font['url'] ) && !empty( $font_url_params ) ) {
$google_font = sprintf( '@import url(%s)', $font['url'], $font_url_params );
if ( !in_array( $google_font, (array)$google_fonts ) ) $google_fonts[] = $google_font;
}
if ( !empty( $font['value'] ) ) $footer_row_inline_styles[] = sprintf( 'font-family:%s !important' , $font['value'] );
}
}
}
}
}
}
if ( !empty( $footer_row_inline_styles ) ) {
$custom_inline_styles[] = sprintf(
'.gw-go-col-wrap-%1$s .gw-go-footer-row[data-row-index="%2$s"] %4$s{ %3$s; }',
$col_index,
$footer_row_index,
implode( '; ', (array)$footer_row_inline_styles ),
isset( $footer_row_data['type'] ) && $footer_row_data['type'] == 'button' ? '.gw-go-btn ' : ''
);
}
// Filter classes & styles
$footer_row_classes = apply_filters( 'go_pricing_front_row_classes',
$footer_row_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$footer_row_styles = apply_filters( 'go_pricing_front_row_styles',
$footer_row_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$footer_row_inline_styles = apply_filters(
"go_pricing_front_footer_row_styles_{$pricing_table['style']}",
array(),
array(
'col_index' => $col_index,
'row_index' => $footer_row_index,
'row_data' => $footer_row_data
),
true
);
if ( !empty( $footer_row_inline_styles ) ) $custom_inline_styles = array_merge( $custom_inline_styles, $footer_row_inline_styles );
// Build html
// Row content
$footer_row_inner_content = '';
switch( $footer_row_data['type'] ) {
case 'html' :
$footer_row_inner_content = isset( $footer_row_data[$footer_row_data['type']]['content'] ) ? $footer_row_data[$footer_row_data['type']]['content'] . $tooltip_html : '';
break;
case 'button' :
$button_data = !empty( $footer_row_data['button'] ) ? $footer_row_data['button'] : array();
$button_css = array();
$button_wrap_classes = array();
$button_classes = array();
$button_atts = array();
$button_attributes = array();
$button_html = '';
$button_wrap_classes[] = 'gw-go-btn-wrap';
$button_classes[] = 'gw-go-btn';
if ( !empty( $button_data['size'] ) ) $button_classes[] = 'gw-go-btn-' . $button_data['size'];
if ( !empty( $button_data['target'] ) ) $button_atts[] = array( 'target', '_blank' );
if ( !empty( $button_data['nofollow'] ) ) $button_atts[] = array( 'rel', 'nofollow' );
if ( $current_style == 'clean' ) {
if ( !empty( $button_data['bg-color'] ) ) $button_css['normal'][] = sprintf( 'background-color:%s !important', $button_data['bg-color'] );
if ( !empty( $button_data['color'] ) ) $button_css['normal'][] = sprintf( 'color:%s !important', $button_data['color'] );
if ( !empty( $button_css['normal'] ) ) $custom_inline_styles[] = sprintf( '.gw-go-col-wrap-%1$s .gw-go-footer-row[data-row-index="%2$s"] .gw-go-btn { %3$s; }',
$col_index,
$footer_row_index,
!empty( $button_css['normal'] ) ? implode( '; ', $button_css['normal'] ) : ''
);
if ( !empty( $button_data['bg-color-hover'] ) ) $button_css['hover'][] = sprintf( 'background-color:%s !important', $button_data['bg-color-hover'] );
if ( !empty( $button_data['color-hover'] ) ) $button_css['hover'][] = sprintf( 'color:%s !important', $button_data['color-hover'] );
if ( !empty( $button_css['hover'] ) ) $custom_inline_styles[] = sprintf( '.gw-go-hover.gw-go-col-wrap-%1$s .gw-go-footer-row[data-row-index="%2$s"] .gw-go-btn { %3$s; }',
$col_index,
$footer_row_index,
!empty( $button_css['hover'] ) ? implode( '; ', $button_css['hover'] ) : ''
);
}
// Filter classes & atts
$button_classes = apply_filters( "go_pricing_front_footer_button_classes_{$pricing_table['style']}",
$button_classes,
array(
'col_index' => $col_index,
'row_index' => $footer_row_index,
'row_data' => $footer_row_data
)
);
$button_atts = apply_filters( 'go_pricing_front_footer_button_atts',
$button_atts,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
foreach ( (array)$button_atts as $button_att ) {
if ( count( (array)$button_att ) == 2 ) $button_attributes[] = sprintf( '%1$s="%2$s"', $button_att[0], esc_attr( $button_att[1] ) );
}
// Build button html
if ( !empty( $button_data['type'] ) ) {
switch( $button_data['type'] ) {
case 'button' :
$button_html = isset( $button_data['code'] ) && $button_data['code'] != '' && isset( $button_data['content'] ) && $button_data['content'] != '' ?
sprintf(
'
%4$s',
esc_attr( $button_data['code'] ),
!empty( $button_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$button_classes ) ) . '"' : '',
!empty( $button_attributes ) ? ' ' . implode( ' ', (array)$button_attributes ) : '',
$button_data['content']
) : '';
break;
case 'submit' :
$button_html = isset( $button_data['code'] ) && $button_data['code'] != '' && isset( $button_data['content'] ) && $button_data['content'] != '' ?
sprintf(
'
%2$s%3$s',
!empty( $button_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$button_classes ) ) . '"' : '',
$button_data['content'],
$button_data['code']
) : '';
break;
case 'custom' :
$button_html = isset( $button_data['code'] ) ? $button_data['code'] : '';
break;
}
}
// Filter footer html
$button_html = apply_filters( 'go_pricing_front_footer_button_html',
$button_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $footer_row_index,
'button_classes' => $button_classes,
'button_atts' => $button_atts,
'button_attributes' => $button_attributes
)
);
$footer_row_inner_content = $button_html;
}
$footer_row_html = !empty( $footer_row_data ) ?
sprintf(
'
',
!empty( $footer_row_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$footer_row_classes ) ) . '"' : '',
!empty( $footer_row_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$footer_row_styles ) ) . ';"' : '',
$footer_row_inner_content
) : '';
// Filter html
$footer_row_html = apply_filters( 'go_pricing_front_footer_row_html',
$footer_row_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'row_index' => $footer_row_index,
'row_classes' => $footer_row_classes,
'row_styles' => $footer_row_styles,
)
);
$footer_rows_html .= $footer_row_html;
}
}
}
// Footer
// Build classes & styles
$footer_classes[] = "gw-go-footer";
// Filter classes & styles
$footer_classes = apply_filters( 'go_pricing_front_footer_classes',
$footer_classes,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
$footer_styles = apply_filters( 'go_pricing_front_footer_styles',
$footer_styles,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type']
)
);
// Build html
$footer_html = !empty( $footer_rows_html ) ?
sprintf(
'',
!empty( $footer_classes ) ? ' class="' . esc_attr( implode( ' ', (array)$footer_classes ) ) . '"' : '',
!empty( $footer_styles ) ? ' style="' . esc_attr( implode( '; ', (array)$footer_styles ) ) . ';"' : '',
$footer_rows_html
) : '';
// Filter html
$footer_html = apply_filters( 'go_pricing_front_footer_html',
$footer_html,
array(
'pricing_table' => $pricing_table,
'col_index' => $col_index,
'col_style_type' => $column_style_data['type'],
'footer_rows_html' => $footer_rows_html,
'footer_classes' => $footer_classes,
'footer_styles' => $footer_styles
)
);
$html .= $footer_html;
/**
* /Column wrappers
*/
$html .='