'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 );
}
}
}