_type_4';
}
if ( $selected_layout == 'layout_6' ) {
$css_class[] = 'bwf_bump_toggle_checkout';
}
if ( $featured_image == true ) {
$css_class[] = 'wfob_enable_image';
$css_class[] = $image_position_cls;
}
$css_class[] = 'wfob_bump_price_on';
$css_class[] = 'wfob_bump_price_on_sale';
$small_description = '';
$sub_title = '';
$add_btn_text = '';
$added_btn_text = '';
$remove_btn_text = '';
if ( isset( $this->wfob_default_model['product_small_description'] ) ) {
$small_description = $this->wfob_default_model['product_small_description'];
}
if ( isset( $this->wfob_default_model['product_small_title'] ) ) {
$sub_title = $this->wfob_default_model['product_small_title'];
}
if ( isset( $this->wfob_default_model['product_add_button_text'] ) ) {
$add_btn_text = $this->wfob_default_model['product_add_button_text'];
}
if ( isset( $this->wfob_default_model['product_added_button_text'] ) ) {
$added_btn_text = $this->wfob_default_model['product_added_button_text'];
}
if ( isset( $this->wfob_default_model['product_remove_button_text'] ) ) {
$remove_btn_text = $this->wfob_default_model['product_remove_button_text'];
}
if ( isset( $this->wfob_default_model['icon_on_button'] ) ) {
$icon_on_button = $this->wfob_default_model['icon_on_button'];
}
/*------------------------------------------Merge Tag----------------------------------------- */
$description_display_none = '';
if ( false !== strpos( $titleHeading, '{{more}}' ) || false !== strpos( $sub_title, '{{more}}' ) || false !== strpos( $small_description, '{{more}}' ) ) {
$description_display_none = 'display:none';
}
$decode_merge_tags = $description;
if ( ! empty( $titleHeading ) ) {
$final_data[ $product_key ]['titleHeading'] = $titleHeading;
}
/* Product Image CSS */
if ( ! empty( $image_width ) ) {
$image_position_style[ $bump_id ]['desktop'][] = 'body #wfob_wrap .wfob_bump[data-product-key="' . $product_key . '"] .wfob_pro_image_wrap{ max-width: ' . $image_width . 'px;}';
$image_position_style[ $bump_id ]['desktop'][] = 'body #wfob_wrap .wfob_bump[data-product-key="' . $product_key . '"]:not(.wfob_img_position_top).wfob_enable_image .bwf_display_col_flex.wfob_pro_txt_wrap{flex:1;}';
$this->dynamic_css[ $product_key ]['mobile'][] = 'body #wfob_wrap .wfob_bump[data-product-key="' . $product_key . '"]:not(.wfob_img_position_top).wfob_enable_image #wfob_wrapper_' . $bump_id . ' .bwf_display_col_flex.wfob_pro_txt_wrap{width: 100%;}';
}
if ( $this->is_pointing_arrow_supported( $design_data ) && isset( $design_data['header_enable_pointing_arrow'] ) && wc_string_to_bool( $design_data['header_enable_pointing_arrow'] ) ) {
if ( '1' == $design_data['point_animation'] ) {
$css_class[] = 'wfob_pointer_animation_action';
}
$css_class[] = 'wfob_pointer_active';
$css_class[] = 'wfob_header_enable_pointing_arrow';
$header_enable_pointing_arrow = wc_string_to_bool( $design_data['header_enable_pointing_arrow'] );
}
if ( isset( $design_data['enable_price'] ) && wc_string_to_bool( $design_data['enable_price'] ) ) {
$css_class[] = 'wfob_enable_price';
}
$css_class[] = 'wfob_enable_featured_image_border';
$inner_wrapper_class = implode( ' ', $css_class );
$preview_bump = true;
$html = '';
ob_start();
include $this->layout_template();
$html = ob_get_clean();
$status = false;
if ( ! empty( $html ) ) {
$status = true;
}
if ( true === $print_bump ) {
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $html is generated from template file with proper escaping
echo $html;
}
$this->bumps_html[ $product_key ] = $html;
$this->single_bump_html = $html;
if ( true == $status ) {
WFOB_Bump_Fc::$number_of_bump_print[ $product_key ] = 1;
}
}
$this->print_multi_product_slider_close( $slider_layout, $print_bump );
/*--------------------------------------------Dynamic Style------------------------------------ */
if ( WFOB_Bump_Fc::$number_of_bump_print >= 1 && apply_filters( 'wfacp_disabled_order_bump_css_printing', true, $this ) ) {
$this->dynamic_css = $this->generate_bump_css( $bump_id, $design_data, $skin_type );
$bump_inline_css = apply_filters( 'wfob_bump_inline_css', $this->dynamic_css, $this );
$dynamic_inline_css = '';
if ( count( $image_position_style ) > 0 ) {
$bump_inline_css = array_merge( $bump_inline_css, $image_position_style );
}
if ( is_array( $bump_inline_css ) && count( $bump_inline_css ) > 0 ) {
foreach ( $bump_inline_css as $dynamic_css_key => $dynamic_css_val ) {
/*-------------------------------Dynamic CSS for Desktop---------------------------------------*/
if ( isset( $dynamic_css_val['desktop'] ) && is_array( $dynamic_css_val['desktop'] ) && count( $dynamic_css_val['desktop'] ) > 0 ) {
$dynamic_inline_css .= '';
}
/*-------------------------------Dynamic CSS for Mobile---------------------------------------*/
if ( isset( $dynamic_css_val['mobile'] ) && is_array( $dynamic_css_val['mobile'] ) && count( $dynamic_css_val['mobile'] ) > 0 ) {
$dynamic_inline_css .= '';
}
if ( isset( $dynamic_css_val['min-media'] ) && is_array( $dynamic_css_val['min-media'] ) && count( $dynamic_css_val['min-media'] ) > 0 ) {
foreach ( $dynamic_css_val['min-media'] as $min_css_key => $min_css_val ) {
$dynamic_inline_css .= '';
}
}
}
}
if ( ! empty( $dynamic_inline_css ) ) {
$this->dynamic_inline_css = $dynamic_inline_css;
$this->wfob_dynamic_css[] = $dynamic_inline_css;
}
}
}
public function generate_bump_css( $bump_id, $design_data = array(), $skin_type = 'bump_skin_type_1' ) {
if ( empty( $bump_id ) || count( $design_data ) == 0 ) {
return array();
}
$selected_layout = '';
if ( isset( $design_data['layout'] ) && ! empty( $design_data['layout'] ) ) {
$selected_layout = $design_data['layout'];
}
$this->set_bump_design_selectors( $bump_id, $selected_layout, $skin_type );
$css_arr = include WFOB_SKIN_DIR . '/global-inline-css.php';
if ( ! is_array( $css_arr ) || count( $css_arr ) == 0 ) {
return $this->dynamic_css;
}
$this->dynamic_css[ $bump_id ] = $css_arr['dynamic_css'];
$this->field_changes['field_changes'] = array();
$this->field_changes['merged_array'] = array();
$this->field_changes['new_key_value_updated'] = array();
if ( isset( $css_arr['field_changes'] ) ) {
$this->field_changes['field_changes'] = $css_arr['field_changes'];
}
if ( isset( $css_arr['merged_array'] ) ) {
$this->field_changes['merged_array'] = $css_arr['merged_array'];
}
if ( isset( $css_arr['new_key_value_updated'] ) ) {
$this->field_changes['new_key_value_updated'] = $css_arr['new_key_value_updated'];
}
if ( isset( $css_arr['temp_dynamic_css'] ) ) {
$this->temp_dynamic_css = $css_arr['temp_dynamic_css'];
}
return $this->dynamic_css;
}
public function layout_template() {
return WFOB_SKIN_DIR . '/layout-default.php';
}
public function get_bumps_html() {
return $this->bumps_html;
}
public function get_single_bump_html() {
return $this->single_bump_html;
}
public function set_bump_design_selectors( $bump_id, $selected_layout, $skin_type ) {
$bump_selector_section = 'body #wfob_wrap .wfob_wrapper[data-wfob-id="' . $bump_id . '"] .wfob_bump.wfob_' . $selected_layout . '.wfob_bump_section';
$bump_selector_wrapper = $bump_selector_section . ' #wfob_wrapper_' . $bump_id;
$title = array(
'heading_background' => array(
'label' => __( 'Background', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'heading_background',
'stylekey' => 'background-color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'background-color:{{value}}',
),
'heading_hover_background' => array(
'label' => __( 'Background Hover', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'heading_hover_background',
'stylekey' => 'background-color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table:hover',
),
'value' => 'background-color:{{value}}',
),
'heading_color' => array(
'label' => __( 'Text', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'heading_color',
'stylekey' => 'color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_title',
),
'value' => 'color:{{value}}',
),
'heading_hover_color' => array(
'label' => __( 'Text Hover Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'heading_hover_color',
'stylekey' => 'color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_title:hover',
),
'value' => 'color:{{value}}',
),
'heading_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'heading_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'selectors' => array(
$bump_selector_wrapper . ' .wfob_title',
$bump_selector_wrapper . ' .wfob_title *',
$bump_selector_wrapper . ' .wfob_title label',
$bump_selector_wrapper . ' .wfob_title span',
$bump_selector_wrapper . ' .wfob_title span.amount',
),
'value' => 'font-size:{{value}}px',
),
'heading_box_padding' => array(
'label' => __( 'Padding', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'heading_box_padding',
'stylekey' => 'padding',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'padding:{{value}}px',
),
'heading_box_border_style' => array(
'label' => __( 'Border Style', 'woofunnels-order-bump' ),
'type' => 'select',
'key' => 'heading_box_border_style',
'stylekey' => 'border-style',
'class' => 'bwf-field-one-half',
'options' => array(
array(
'label' => 'None',
'value' => 'none',
'key' => 'none',
),
array(
'label' => 'Solid',
'value' => 'solid',
'key' => 'solid',
),
array(
'label' => 'Dotted',
'value' => 'dotted',
'key' => 'dotted',
),
array(
'label' => 'Dashed',
'value' => 'dashed',
'key' => 'dashed',
),
),
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'border-style:{{value}}',
),
'heading_box_border_color' => array(
'label' => __( 'Border Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'heading_box_border_color',
'stylekey' => 'border-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'border-color:{{value}}',
),
'heading_box_border_width' => array(
'label' => __( 'Border Width', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'heading_box_border_width',
'stylekey' => 'border-width',
'class' => 'bwf-field-one-full',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'border-width:{{value}}px',
),
'heading_box_border_radius' => array(
'label' => __( 'Corner Radius', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'heading_box_border_radius',
'stylekey' => 'border-radius',
'min' => 0,
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_bgBox_table',
),
'value' => 'border-radius:{{value}}px',
),
'header_enable_pointing_arrow' => array(
'label' => __( 'Enable Arrow', 'woofunnels-order-bump' ),
'type' => 'toggle',
'key' => 'header_enable_pointing_arrow',
'contentClass' => 'wfob_header_enable_pointing_arrow',
'selectors' => array(
$bump_selector_section,
),
'value' => '',
),
'point_animation' => array(
'label' => __( 'Arrow Animation', 'woofunnels-order-bump' ),
'type' => 'toggle',
'key' => 'point_animation',
'contentClass' => 'wfob_point_animation',
'toggler' => array(
'key' => 'header_enable_pointing_arrow',
'value' => true,
),
'selectors' => array(
$bump_selector_section,
),
'value' => '',
),
'point_animation_color' => array(
'label' => __( 'Pointer Animation color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'point_animation_color',
'stylekey' => 'fill',
'toggler' => array(
'key' => 'header_enable_pointing_arrow',
'value' => true,
),
'selectors' => array(
$bump_selector_section . ' .wfob_checkbox_input_wrap span.wfob_blink_img_wrap svg path',
),
'value' => 'fill:{{value}}',
),
);
$image = array(
'enable_featured_image_border' => array(
'label' => __( 'Enable Image Border', 'woofunnels-order-bump' ),
'type' => 'toggle',
'key' => 'enable_featured_image_border',
'contentClass' => 'wfob_enable_featured_image_border',
'class' => 'bwf-field-hide',
'selectors' => array(
$bump_selector_section,
),
'value' => '',
),
'featured_image_border_style' => array(
'label' => __( 'Border Style', 'woofunnels-order-bump' ),
'type' => 'select',
'key' => 'featured_image_border_style',
'stylekey' => 'border-style',
'class' => 'bwf-field-one-half',
'options' => array(
array(
'label' => 'None',
'value' => 'none',
'key' => 'none',
),
array(
'label' => 'Solid',
'value' => 'solid',
'key' => 'solid',
),
array(
'label' => 'Dotted',
'value' => 'dotted',
'key' => 'dotted',
),
array(
'label' => 'Dashed',
'value' => 'dashed',
'key' => 'dashed',
),
),
'selectors' => array(
$bump_selector_wrapper . ' .wfob_pro_img_wrap img',
),
'value' => 'border-style:{{value}}',
),
'featured_image_border_color' => array(
'label' => __( 'Border Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'featured_image_border_color',
'stylekey' => 'border-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_pro_img_wrap img',
),
'value' => 'border-color:{{value}}',
),
'featured_image_border_width' => array(
'label' => __( 'Border Width', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'stylekey' => 'border-width',
'styleUnit' => 'px',
'key' => 'featured_image_border_width',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_pro_img_wrap img',
),
'value' => 'border-width:{{value}}px',
),
'featured_image_border_radius' => array(
'label' => __( 'Corner Radius', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'featured_image_border_radius',
'stylekey' => 'border-radius',
'styleUnit' => 'px',
'min' => 0,
'selectors' => array(
$bump_selector_wrapper . ' .wfob_pro_img_wrap img',
),
'value' => 'border-radius:{{value}}px',
),
);
$content = array(
'content_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'content_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'selectors' => array(
$bump_selector_wrapper . ' .wfob_text_inner',
$bump_selector_wrapper . ' .wfob_text_inner p',
$bump_selector_wrapper . ' .wfob_text_inner > span',
$bump_selector_wrapper . ' .wfob_text_inner span.amount',
$bump_selector_wrapper . ' .wfob_text_inner span bdi',
$bump_selector_wrapper . ' .wfob_description_wrap a:not(.wfob_qv-button)',
$bump_selector_wrapper . ' .wfob_description_wrap .wfob_selected_attributes',
$bump_selector_wrapper . ' .wfob_description_wrap .wfob_selected_attributes *',
$bump_selector_wrapper . ' .wfob_text_inner ul',
$bump_selector_wrapper . ' .wfob_text_inner ul li',
$bump_selector_wrapper . ' .wfob_text_inner ol',
$bump_selector_wrapper . ' .wfob_text_inner ol li',
),
'class' => 'bwf-field-one-half',
'value' => 'font-size:{{value}}px',
),
'content_color' => array(
'label' => __( 'Text Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'content_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_text_inner',
$bump_selector_wrapper . ' .wfob_text_inner p',
$bump_selector_wrapper . ' .wfob_text_inner > span',
$bump_selector_wrapper . ' .wfob_text_inner span.amount',
$bump_selector_wrapper . ' .wfob_text_inner span bdi',
$bump_selector_wrapper . ' .wfob_description_wrap a:not(.wfob_qv-button)',
$bump_selector_wrapper . ' .wfob_description_wrap .wfob_selected_attributes',
$bump_selector_wrapper . ' .wfob_description_wrap .wfob_selected_attributes *',
$bump_selector_wrapper . ' .wfob_text_inner ul',
$bump_selector_wrapper . ' .wfob_text_inner ul li',
$bump_selector_wrapper . ' .wfob_text_inner ol',
$bump_selector_wrapper . ' .wfob_text_inner ol li',
),
'value' => 'color:{{value}}',
),
'content_variation_link_color' => array(
'label' => __( 'Variant Link', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'content_variation_link_color',
'stylekey' => 'color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_qv-button',
),
'value' => 'color:{{value}}',
),
'content_variation_link_hover_color' => array(
'label' => __( 'Link Hover Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'content_variation_link_hover_color',
'stylekey' => 'color',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_qv-button:hover',
),
'value' => 'color:{{value}}',
),
'content_box_padding' => array(
'label' => __( 'Padding', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'content_box_padding',
'stylekey' => 'padding',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_text_inner',
),
'value' => 'padding:{{value}}px',
),
);
/**
* A bump price is printed one of two ways (see WFOB_Dynamic_Merge_Tags::price()):
* discounted products go through wc_format_sale_price() and render old new,
* everything else goes through wc_price() and renders a BARE amount as a direct child of
* .wfob_price. That bare amount is the price the customer actually pays, but it has always
* been styled by the Regular Price group — the styling meant for the struck-through original.
* On Skin 12 that shows up side by side: a discounted card renders its sale price in green at
* 14px while an undiscounted card in the very next slide renders its real price in the muted
* struck-through grey at 12px (#9CA3AF/12 vs #2E9E5B/14 by default), reading as disabled and
* visibly smaller than its neighbour.
* So for Skin 12 the bare amount follows the SALE price group — BOTH colour and font size, so
* every actually-charged price in the slider is rendered identically. Every other layout keeps
* the historical mapping. The two groups share one selector list each because the font-size
* and colour fields target exactly the same nodes.
*/
$plain_price_selectors = array(
$bump_selector_wrapper . ' .wfob_price_container .wfob_price > .woocommerce-Price-amount',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price > .woocommerce-Price-amount *',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price > .woocommerce-Price-amount bdi',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price > .woocommerce-Price-amount span',
);
$regular_price_selectors = array(
$bump_selector_wrapper . ' .wfob_price_container .wfob_price del',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price del *',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price del bdi',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price del span *',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price del span.amount',
);
$sale_price_selectors = array(
$bump_selector_wrapper . ' .wfob_price_container .wfob_price ins',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price ins *',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price ins bdi',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price ins span *',
$bump_selector_wrapper . ' .wfob_price_container .wfob_price ins span.amount',
);
if ( 'layout_12' === $selected_layout ) {
$sale_price_selectors = array_merge( $sale_price_selectors, $plain_price_selectors );
} else {
$regular_price_selectors = array_merge( $regular_price_selectors, $plain_price_selectors );
}
$price = array(
'enable_price' => array(
'label' => __( 'Enable Price', 'woofunnels-order-bump' ),
'type' => 'toggle',
'key' => 'enable_price',
'contentClass' => 'wfob_enable_price',
'selectors' => array(
$bump_selector_section,
),
'value' => '',
),
'regular_price_label_text' => array(
'label' => __( 'Regular Price', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'regular_price_label_text',
'class' => 'has-border',
'value' => '',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
'price_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'price_font_size',
'stylekey' => 'font-size',
'class' => 'bwf-field-one-half',
'min' => 0,
'styleUnit' => 'px',
'selectors' => $regular_price_selectors,
'value' => 'font-size:{{value}}px',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
'price_color' => array(
'label' => __( 'Text', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'price_color',
'class' => 'bwf-field-one-half',
'stylekey' => 'color',
'selectors' => $regular_price_selectors,
'value' => 'color:{{value}}',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
'sale_price_label_text' => array(
'label' => __( 'Sale Price', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'sale_price_label_text',
'class' => 'has-border',
'value' => '',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
'price_sale_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'price_sale_font_size',
'stylekey' => 'font-size',
'class' => 'bwf-field-one-half',
'min' => 0,
'styleUnit' => 'px',
'selectors' => $sale_price_selectors,
'value' => 'font-size:{{value}}px',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
'price_sale_color' => array(
'label' => __( 'Text', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'price_sale_color',
'class' => 'bwf-field-one-half',
'stylekey' => 'color',
'selectors' => $sale_price_selectors,
'value' => 'color:{{value}}',
'toggler' => array(
'key' => 'enable_price',
'value' => true,
),
),
);
$layout = array(
'box_background' => array(
'label' => __( 'Background Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'box_background',
'stylekey' => 'background-color',
'selectors' => array(
$bump_selector_section,
),
'value' => 'background:{{value}}',
),
'box_background_hover' => array(
'label' => __( 'Background Hover Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'box_background_hover',
'stylekey' => 'background-color',
'selectors' => array(
$bump_selector_section . ':hover',
),
'value' => 'background:{{value}}',
),
'box_padding' => array(
'label' => __( 'Padding', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'box_padding',
'stylekey' => 'padding',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_section,
),
'value' => 'padding:{{value}}px',
),
'enable_box_border' => array(
'label' => __( 'Enable Box Border', 'woofunnels-order-bump' ),
'type' => 'toggle',
'key' => 'enable_box_border',
'class' => 'bwf-field-hide',
'contentClass' => 'wfob_enable_box_border',
'selectors' => array(
$bump_selector_section,
),
'value' => '',
'ref_key' => array(
'key' => 'enable_box_border',
'value' => 'border-style:none',
),
),
'border_style' => array(
'label' => __( 'Border Style', 'woofunnels-order-bump' ),
'type' => 'select',
'key' => 'border_style',
'stylekey' => 'border-style',
'class' => 'bwf-field-one-half',
'options' => array(
array(
'label' => 'None',
'value' => 'none',
'key' => 'none',
),
array(
'label' => 'Solid',
'value' => 'solid',
'key' => 'solid',
),
array(
'label' => 'Dotted',
'value' => 'dotted',
'key' => 'dotted',
),
array(
'label' => 'Dashed',
'value' => 'dashed',
'key' => 'dashed',
),
),
'selectors' => array(
$bump_selector_section,
),
'value' => 'border-style:{{value}}',
'ref_key' => 'enable_box_border',
),
'border_color' => array(
'label' => __( 'Border Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'border_color',
'stylekey' => 'border-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_section,
),
'value' => 'border-color:{{value}}',
'ref_key' => 'enable_box_border',
),
'border_width' => array(
'label' => __( 'Border Width', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'border_width',
'stylekey' => 'border-width',
'styleUnit' => 'px',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_section,
),
'value' => 'border-width:{{value}}px',
'ref_key' => 'enable_box_border',
),
'box_border_radius' => array(
'label' => __( 'Corner Radius', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'box_border_radius',
'stylekey' => 'border-radius',
'styleUnit' => 'px',
'min' => 0,
'selectors' => array(
$bump_selector_section,
),
'value' => 'border-radius:{{value}}px',
),
'bump_max_width' => array(
'label' => __( 'Width', 'woofunnels-order-bump' ),
'type' => 'width',
'key' => 'bump_max_width',
'stylekey' => 'max-width',
'defaultCustomValue' => 540,
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_section,
),
'value' => 'max-width:{{value}}px',
),
);
/*--------------------------------Exclusive Content------------------------------*/
$exlusive_content_position_list = array(
array(
'label' => __( 'Outside - Top Left', 'woofunnels-order-bump' ),
'value' => 'wfob_exclusive_outside_top_left',
'key' => 'wfob_exclusive_outside_top_left',
),
array(
'label' => __( 'Outside - Top Right', 'woofunnels-order-bump' ),
'value' => 'wfob_exclusive_outside_top_right',
'key' => 'wfob_exclusive_outside_top_right',
),
array(
'label' => __( 'Inside - Above Description', 'woofunnels-order-bump' ),
'value' => 'wfob_exclusive_above_description',
'key' => 'wfob_exclusive_above_description',
),
array(
'label' => __( 'Inside - Below Description', 'woofunnels-order-bump' ),
'value' => 'wfob_exclusive_below_description',
'key' => 'wfob_exclusive_below_description',
),
);
/*--------------------------------Exclusive Content------------------------------*/
$sub_heading = array();
$short_description = array();
$exclude_keys = array();
if ( $skin_type != 'bump_skin_type_1' && $skin_type != 'bump_skin_type_3' && $selected_layout != 'layout_7' && $selected_layout != 'layout_11' ) {
$exlusive_content_position_list[] = array(
'label' => 'Above Title',
'value' => 'wfob_exclusive_above_title',
'key' => 'wfob_exclusive_above_title',
);
}
$exclusive = array(
'exclusive_content_bg_color' => array(
'label' => __( 'Background', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'exclusive_content_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_exclusive_content span',
),
'value' => 'background-color:{{value}}',
),
'exclusive_content_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'exclusive_content_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_exclusive_content',
$bump_selector_wrapper . ' .wfob_exclusive_content *',
$bump_selector_wrapper . ' .wfob_exclusive_content span',
),
'value' => 'font-size:{{value}}px',
),
'exclusive_content_color' => array(
'label' => __( 'Text', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'exclusive_content_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_exclusive_content',
$bump_selector_wrapper . ' .wfob_exclusive_content *',
$bump_selector_wrapper . ' .wfob_exclusive_content span',
),
'value' => 'color:{{value}}',
),
'exclusive_content_position' => array(
'label' => __( 'Exclusive Content Position', 'woofunnels-order-bump' ),
'type' => 'select',
'allClasses' => array(
'wfob_exclusive_above_description',
'wfob_exclusive_below_description',
'wfob_exclusive_above_title',
'wfob_exclusive_outside_top_right',
'wfob_exclusive_outside_top_left',
),
'key' => 'exclusive_content_position',
'class' => 'bwf-field-one-full',
'options' => $exlusive_content_position_list,
'selectors' => array(
$bump_selector_section,
),
),
);
/*--------------------------------Social proof Tool tip---------------------------------------- */
$social_proof_tooltip = array(
'social_proof_tooltip_layout_label' => array(
'label' => __( 'Layout', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'social_proof_tooltip_layout_label',
'class' => 'has-border',
'value' => '',
),
'social_proof_tooltip_bg_color' => array(
'label' => __( 'Background', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'social_proof_tooltip_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip',
),
'value' => 'background-color:{{value}}',
),
'social_proof_tooltip_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'social_proof_tooltip_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-content',
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-content *',
),
'value' => 'font-size:{{value}}px',
),
'social_proof_tooltip_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'social_proof_tooltip_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-content',
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-content *',
),
'value' => 'color:{{value}}',
),
'social_proof_tooltip_heading_label' => array(
'label' => __( 'Heading', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'social_proof_tooltip_heading_label',
'class' => 'has-border',
'value' => '',
),
'social_proof_tooltip_heading_bg_color' => array(
'label' => __( 'Background', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'social_proof_tooltip_heading_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip .wfob-social-proof-tooltip-header',
),
'value' => 'background-color:{{value}}',
),
'social_proof_tooltip_heading_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'social_proof_tooltip_heading_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-header',
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-header *',
),
'value' => 'font-size:{{value}}px',
),
'social_proof_tooltip_heading_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'social_proof_tooltip_heading_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-header',
$bump_selector_wrapper . ' .wfob-social-proof-tooltip-header *',
),
'value' => 'color:{{value}}',
),
);
/*--------------------------------Slider arrows (Skin 12 only)--------------------------- */
/**
* Skin 12 is the one skin whose products render as a horizontally scrolling track, so
* it is the only one that has prev/next chevrons to switch off. Both ship ticked.
*
* These two target .wfob_l12_slider — the track wrapper, which sits ABOVE the per-card
* bump section every other field in this panel is scoped to, because the arrows are
* siblings of the track and not descendants of any one card. Ticked adds the class (see
* applyBumpPreview() in the editor), and the stylesheet paints an arrow only for a
* breakpoint whose class is on the wrapper, so desktop and mobile stay independent.
*/
$slider_arrows = array();
if ( 'layout_12' === $selected_layout ) {
$slider_arrows = array(
'slider_arrow_desktop' => array(
'label' => __( 'Show Arrows on Desktop', 'woofunnels-order-bump' ),
'type' => 'checkbox',
'key' => 'slider_arrow_desktop',
'class' => 'bwf-field-one-full',
'contentClass' => 'wfob_l12_arrow_desktop',
'selectors' => array(
'body #wfob_wrap .wfob_l12_slider',
),
'value' => '',
'hint' => __( 'Arrows only show when the products overflow the slider. Dragging and swiping keep working either way.', 'woofunnels-order-bump' ),
),
'slider_arrow_mobile' => array(
'label' => __( 'Show Arrows on Mobile', 'woofunnels-order-bump' ),
'type' => 'checkbox',
'key' => 'slider_arrow_mobile',
'class' => 'bwf-field-one-full',
'contentClass' => 'wfob_l12_arrow_mobile',
'selectors' => array(
'body #wfob_wrap .wfob_l12_slider',
),
'value' => '',
'hint' => __( 'Applies below 768px.', 'woofunnels-order-bump' ),
),
);
}
/*--------------------------------Old Skins--------------------------------------------- */
if ( $selected_layout == 'layout_3' || $selected_layout == 'layout_4' ) {
$exclusive = array();
$sub_heading = array(
'sub_heading_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'sub_heading_font_size',
'stylekey' => 'font-size',
'min' => 0,
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_c_sub_head',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head span',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head span bdi',
),
'value' => 'font-size:{{value}}px',
),
'sub_heading_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'sub_heading_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_c_sub_head',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head span',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head span bdi',
),
'value' => 'color:{{value}}',
),
'sub_heading_hover_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'sub_heading_hover_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_c_sub_head:hover',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head:hover span',
$bump_selector_wrapper . ' .wfob_l3_c_sub_head:hover span bdi',
),
'value' => 'color:{{value}}',
),
);
$short_description = array(
'sub_content_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'sub_content_font_size',
'stylekey' => 'font-size',
'styleUnit' => 'px',
'min' => 0,
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_c_sub_desc',
$bump_selector_wrapper . ' .wfob_l3_c_sub_desc *',
),
'value' => 'font-size:{{value}}px',
),
'sub_content_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'sub_content_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_c_sub_desc',
$bump_selector_wrapper . ' .wfob_l3_c_sub_desc span',
$bump_selector_wrapper . ' .wfob_l3_c_sub_desc a:not(.wfob_read_more_link)',
),
'value' => 'color:{{value}}',
),
);
}
if ( $skin_type == 'bump_skin_type_2' || $skin_type == 'bump_skin_type_4' ) {
$add_to_button = array(
'add_button_bg_color' => array(
'label' => __( 'Background Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'add_button_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'background-color:{{value}}',
),
'add_button_hover_bg_color' => array(
'label' => __( 'Background Hover Color', 'woofunnels-order-bump' ),
'type' => 'color',
/*
Was 'add_button_color' — the button's TEXT colour. The CSS below is emitted
from the array key, so the hover background read the right stored value
while the panel control edited a different one: the hover background could
never be changed, and touching it recoloured the button text instead. */
'key' => 'add_button_hover_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add:hover',
),
'value' => 'background-color:{{value}}',
),
'add_button_color' => array(
'label' => __( 'Text', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'add_button_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add span',
),
'value' => 'color:{{value}}',
),
'add_button_hover_color' => array(
'label' => __( 'Hover Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'add_button_hover_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add:hover',
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add:hover > span',
),
'value' => 'color:{{value}}',
),
'add_button_font_size' => array(
'label' => __( 'Font Size', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'add_button_font_size',
'stylekey' => 'font-size',
'min' => 0,
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add span',
),
'value' => 'font-size:{{value}}px',
),
'add_button_padding' => array(
'label' => __( 'Padding', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'add_button_padding',
'stylekey' => 'padding',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'padding:{{value}}px',
),
'add_button_border_radius' => array(
'label' => __( 'Corner Radius', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'add_button_border_radius',
'stylekey' => 'border-radius',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'border-radius:{{value}}px',
),
'add_button_border_style' => array(
'label' => __( 'Border Style', 'woofunnels-order-bump' ),
'type' => 'select',
'key' => 'add_button_border_style',
'stylekey' => 'border-style',
'class' => 'bwf-field-one-half',
'options' => array(
array(
'label' => 'None',
'value' => 'none',
'key' => 'none',
),
array(
'label' => 'Solid',
'value' => 'solid',
'key' => 'solid',
),
array(
'label' => 'Dotted',
'value' => 'dotted',
'key' => 'dotted',
),
array(
'label' => 'Dashed',
'value' => 'dashed',
'key' => 'dashed',
),
),
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'border-style:{{value}}',
),
'add_button_border_color' => array(
'label' => __( 'Border Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'add_button_border_color',
'stylekey' => 'border-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'border-color:{{value}}',
),
'add_button_border_width' => array(
'label' => __( 'Border Width', 'woofunnels-order-bump' ),
'type' => 'dimension-control',
'key' => 'add_button_border_width',
'stylekey' => 'border-width',
'styleUnit' => 'px',
'class' => 'bwf-field-one-full',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'border-width:{{value}}px',
),
'add_button_width' => array(
'label' => __( 'Width', 'woofunnels-order-bump' ),
'type' => 'number',
'key' => 'add_button_width',
'stylekey' => 'min-width',
'styleUnit' => 'px',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_add',
),
'value' => 'min-width:{{value}}px',
),
'added_button_label_text' => array(
'label' => __( 'Added To Cart Button', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'added_button_label_text',
'class' => 'has-border',
'value' => '',
),
'added_button_color' => array(
'label' => __( 'Added Button Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'added_button_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present',
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present span',
),
'value' => 'color:{{value}}',
),
'added_button_bg_color' => array(
'label' => __( 'Background Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'added_button_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present',
),
'value' => 'background-color:{{value}}',
),
'remove_button_label_text' => array(
'label' => __( 'Removed from Cart Button', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'remove_button_label_text',
'class' => 'has-border',
'value' => '',
),
'remove_button_color' => array(
'label' => __( 'Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'remove_button_color',
'stylekey' => 'color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_s_btn a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present:hover',
$bump_selector_wrapper . ' .wfob_l3_s_btn a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present:hover span',
),
'value' => 'color:{{value}}',
),
'remove_button_bg_color' => array(
'label' => __( 'Background Color', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'remove_button_bg_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob_l3_s_btn a.wfob_l3_f_btn.wfob_btn_remove.wfob_item_present:hover',
),
'value' => 'background-color:{{value}}',
),
'icon_on_button' => array(
'label' => __( 'Show Icon', 'woofunnels-order-bump' ),
'type' => 'select',
'key' => 'icon_on_button',
'class' => 'bwf-field-one-full',
'options' => array(
array(
'label' => 'None',
'value' => 'none',
'key' => 'none',
),
array(
'label' => 'Cursor',
'value' => 'wfob_cta_cursor',
'key' => 'cursor',
'icon' => '',
),
array(
'label' => 'Cart',
'value' => 'wfob_cta_cart',
'icon' => '',
),
),
'selectors' => array(
$bump_selector_section,
),
'classList' => array(
'none' => '',
'wfob_cta_cursor' => 'wfob_cta_cursor',
'wfob_cta_cart' => 'wfob_cta_cart',
),
),
);
$final_fields = $layout + $title + $sub_heading + $short_description + $add_to_button + $image + $content + $price + $exclusive;
} elseif ( $selected_layout == 'layout_6' ) {
$toggle_color = array(
'unselect_line_color' => array(
'label' => __( 'Line Color (Inactive)', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'unselect_line_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-switch + label span.sw',
),
'value' => 'background-color:{{value}}',
),
'select_line_color' => array(
'label' => __( 'Line Color (Active)', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'select_line_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-switch:checked + label span.sw',
),
'value' => 'background-color:{{value}}',
),
'switch_color_label_text' => array(
'label' => __( 'Switch Color', 'woofunnels-order-bump' ),
'type' => 'bwf-label',
'key' => 'switch_color_label_text',
'class' => 'has-border',
'value' => '',
),
'unselect_switch_color' => array(
'label' => __( 'Circle Color (Inactive)', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'unselect_switch_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-switch + label span.sw:before',
),
'value' => 'background-color:{{value}}',
),
'select_switch_color' => array(
'label' => __( 'Circle Color (Active)', 'woofunnels-order-bump' ),
'type' => 'color',
'key' => 'select_switch_color',
'stylekey' => 'background-color',
'class' => 'bwf-field-one-half',
'selectors' => array(
$bump_selector_wrapper . ' .wfob-switch:checked + label span:before',
),
'value' => 'background-color:{{value}}',
),
);
$final_fields = $layout + $title + $toggle_color + $image + $content + $price + $exclusive;
} else {
$final_fields = $layout + $title + $image + $content + $price + $exclusive;
}
/**
* Add Social Proof setting
*/
// $final_fields = $social_proof_tooltip;
if ( is_array( $social_proof_tooltip ) && count( $social_proof_tooltip ) > 0 ) {
$final_fields = array_merge( $final_fields, $social_proof_tooltip );
}
/**
* Add Slider arrow settings (Skin 12 only, empty everywhere else)
*/
if ( count( $slider_arrows ) > 0 ) {
$final_fields = array_merge( $final_fields, $slider_arrows );
}
/*---------------------------------Remove Keys from template ------------------------------------------*/
if ( $selected_layout == 'layout_3' || $selected_layout == 'layout_4' || $selected_layout == 'layout_6' || $selected_layout == 'layout_9' || $selected_layout == 'layout_10' ) {
$exclude_keys[] = 'heading_background';
$exclude_keys[] = 'heading_hover_background';
$exclude_keys[] = 'header_enable_pointing_arrow';
$exclude_keys[] = 'point_animation';
$exclude_keys[] = 'heading_box_border_style';
$exclude_keys[] = 'heading_box_border_color';
$exclude_keys[] = 'heading_box_border_width';
$exclude_keys[] = 'heading_box_border_radius';
}
/*
The pointing arrow sits beside the checkbox of a single card. A slider skin lays its
products out in a scrollable track — every card carries its own checkbox, so the arrow
has nothing to single out and the skin never paints one (see is_enable_pointer()).
Drop the three controls rather than leave switches that change nothing on screen. */
if ( in_array( $selected_layout, $this->get_slider_layouts(), true ) ) {
$exclude_keys[] = 'header_enable_pointing_arrow';
$exclude_keys[] = 'point_animation';
$exclude_keys[] = 'point_animation_color';
}
if ( $selected_layout !== 'layout_3' && $selected_layout !== 'layout_4' ) {
$exclude_keys[] = 'remove_button_label_text';
$exclude_keys[] = 'remove_button_color';
$exclude_keys[] = 'remove_button_bg_color';
}
if ( is_array( $exclude_keys ) && count( $exclude_keys ) > 0 ) {
foreach ( $exclude_keys as $index => $unset_key ) {
if ( ! isset( $final_fields[ $unset_key ] ) ) {
continue;
}
unset( $final_fields[ $unset_key ] );
}
}
$this->bump_all_selectors = $final_fields;
}
public function get_bump_design_selectors() {
return $this->bump_all_selectors;
}
public function get_dynamic_inline_css() {
return $this->dynamic_inline_css;
}
public function get_wfob_bump_css() {
return $this->wfob_dynamic_css;
}
public function override_design_data_keys( $design_data, $layout ) {
if ( ! is_array( $this->override_layout_design_data ) || count( $this->override_layout_design_data ) == 0 ) {
return $design_data;
}
$overide_keys = array();
if ( isset( $this->override_layout_design_data[ $layout ] ) ) {
$overide_keys = $this->override_layout_design_data[ $layout ];
}
if ( is_array( $overide_keys ) && count( $overide_keys ) > 0 ) {
foreach ( $overide_keys as $k => $v ) {
$design_data[ $k ] = $v;
}
}
return $design_data;
}
/**
* @return boolean
*/
public function need_to_hide( $wc_product, $cart_item_key ) {
$status = ( ! empty( $cart_item_key ) && isset( $this->settings['order_bump_auto_hide'] ) && wc_string_to_bool( $this->settings['order_bump_auto_hide'] ) );
// backward compatibility
$status = apply_filters( 'wfob_hide_order_bump_after_selected', $status, $this->get_id(), $cart_item_key );
return apply_filters( 'wfob_do_not_display_order_bump_product', $status, $this->get_id(), $wc_product, $cart_item_key );
}
}
}