selectors; return self::general_settings() + self::cart_table() + self::action_control() + self::image_settings() + ButtonSettings::style_settings( $widget ) + self::input_style() + self::cart_empty() + self::return_shop_button_style() + self::notice_style(); } /** * Widget Field * * @return array */ public static function cart_table() { $fields = [ 'cart_table_settings' => [ 'mode' => 'section_start', 'tab' => 'style', 'label' => esc_html__( 'Cart Table', 'shopbuilder' ), ], 'cart_table_width' => [ 'mode' => 'responsive', 'label' => esc_html__( 'Table Minimum Width', 'shopbuilder' ), 'type' => 'slider', 'separator' => 'default', 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 320, 'max' => 3000, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ self::$selectors['cart_table_width'] => 'min-width: {{SIZE}}{{UNIT}};', ], ], 'cart_table_border' => [ 'mode' => 'group', 'type' => 'border', 'label' => esc_html__( 'Table Border', 'shopbuilder' ), 'selector' => self::$selectors['cart_table_border'], 'size_units' => [ 'px' ], ], 'table_column_header_padding' => [ 'label' => esc_html__( 'Column Header Padding(px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['table_column_header_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'table_content_column_padding' => [ 'label' => esc_html__( 'Column Padding (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['table_content_column_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'cart_remove_icon_heading' => [ 'type' => 'html', 'raw' => sprintf( '

%s

', esc_html__( 'Remove Cart Item', 'shopbuilder' ) ), 'content_classes' => 'elementor-panel-heading-title', ], 'cart_remove_button_size' => [ 'label' => esc_html__( 'Remove Button Size', 'shopbuilder' ), 'type' => 'slider', 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ self::$selectors['cart_remove_button_size'] => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ], 'cart_remove_icon_size' => [ 'label' => esc_html__( 'Remove Icon', 'shopbuilder' ), 'type' => 'slider', 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ self::$selectors['cart_remove_icon_size'] => 'font-size: {{SIZE}}{{UNIT}};', ], ], 'cart_icon_color' => [ 'label' => esc_html__( 'Cart Icon Color', 'shopbuilder' ), 'type' => 'color', 'separator' => 'default', 'selectors' => [ self::$selectors['cart_icon_color'] => 'color: {{VALUE}};', ], ], 'action_button_padding' => [ 'label' => esc_html__( 'Action Button Area padding(px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['action_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'table_wrapper_margin' => [ 'label' => esc_html__( 'Table Wrapper Margin(px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['table_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'cart_table_settings_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function image_settings() { $fields = [ 'table_image_section' => [ 'mode' => 'section_start', 'label' => esc_html__( 'Image ', 'shopbuilder' ), 'tab' => 'style', ], 'table_thumbnail_width' => [ 'mode' => 'responsive', 'label' => esc_html__( 'Thumbnail Image Width', 'shopbuilder' ), 'type' => 'slider', 'size_units' => [ '%', 'px' ], 'separator' => 'default', 'range' => [ '%' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], 'px' => [ 'min' => 0, 'max' => 2000, 'step' => 1, ], ], 'default' => [ 'unit' => '%', ], 'selectors' => [ self::$selectors['table_thumbnail_width'] => 'width: {{SIZE}}{{UNIT}} !important;', ], ], 'table_thumbnail_padding' => [ 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['table_thumbnail_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ], 'table_image_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function general_settings() { $fields = [ 'general_section' => [ 'mode' => 'section_start', 'label' => esc_html__( 'General ', 'shopbuilder' ), ], 'show_coupon_field' => [ 'label' => esc_html__( 'Show Coupon field?', 'shopbuilder' ), 'type' => 'switch', 'description' => esc_html__( 'Switch on to show Coupon.', 'shopbuilder' ), 'separator' => 'default', 'default' => 'yes', ], 'cart_empty_message' => [ 'type' => 'text', 'label' => esc_html__( 'Cart Empty Text', 'shopbuilder' ), 'description' => esc_html__( 'Leave Empty For default.', 'shopbuilder' ), ], 'return_to_shop_text' => [ 'type' => 'text', 'label' => esc_html__( 'Return to shop', 'shopbuilder' ), 'description' => esc_html__( 'Return to shop button text. Leave Empty For default.', 'shopbuilder' ), ], 'cart_table' => [ 'type' => 'repeater', 'mode' => 'repeater', 'label' => esc_html__( 'Cart Table', 'shopbuilder' ), 'fields' => [ 'cart_table_items' => [ 'label' => esc_html__( 'Table Item', 'shopbuilder' ), 'type' => 'select', 'separator' => 'default', 'default' => 'remove', 'options' => [ 'remove' => esc_html__( 'Remove', 'shopbuilder' ), 'thumbnail' => esc_html__( 'Thumbnail', 'shopbuilder' ), 'name' => esc_html__( 'Product Title', 'shopbuilder' ), 'price' => esc_html__( 'Price', 'shopbuilder' ), 'quantity' => esc_html__( 'Quantity', 'shopbuilder' ), 'subtotal' => esc_html__( 'Total', 'shopbuilder' ), 'custom_field' => esc_html__( 'Custom Field', 'shopbuilder' ), ], ], 'cart_table_heading_title' => [ 'label' => esc_html__( 'Heading', 'shopbuilder' ), 'type' => 'text', 'separator' => 'default', ], 'cart_table_thumbnail_size' => [ 'type' => 'select', 'label' => esc_html__( 'Thumbnail Size', 'shopbuilder' ), 'default' => 'woocommerce_thumbnail', 'options' => Fns::get_image_sizes(), 'condition' => [ 'cart_table_items' => 'thumbnail', ], ], 'cart_table_remove_icon' => [ 'label' => esc_html__( 'Icon', 'shopbuilder' ), 'type' => 'icons', 'fa4compatibility' => 'breadcrumbsicon', 'default' => [ 'value' => 'fas fa-times-circle', 'library' => 'fa-solid', ], 'condition' => [ 'cart_table_items' => 'remove', ], ], 'cart_table_custom_field' => [ 'label' => esc_html__( 'Meta Field Key', 'shopbuilder' ), 'type' => 'text', 'condition' => [ 'cart_table_items' => 'custom_field', ], ], 'cart_table_custom_field_fallback' => [ 'label' => esc_html__( 'Fallback', 'shopbuilder' ), 'type' => 'text', 'default' => '', 'description' => esc_html__( 'Show this if field value is empty', 'shopbuilder' ), 'condition' => [ 'cart_table_items' => 'custom_field', ], ], 'cart_table_cell_width' => [ 'mode' => 'responsive', 'label' => esc_html__( 'Column Width', 'shopbuilder' ), 'type' => 'slider', 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ self::$selectors['cart_table_cell_width']['th'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', self::$selectors['cart_table_cell_width']['td'] . '{{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', ], ], ], 'default' => [ [ 'cart_table_items' => 'remove', 'cart_table_heading_title' => esc_html__( 'Remove', 'shopbuilder' ), ], [ 'cart_table_items' => 'thumbnail', 'cart_table_heading_title' => esc_html__( 'Thumbnail', 'shopbuilder' ), ], [ 'cart_table_items' => 'name', 'cart_table_heading_title' => esc_html__( 'Product Title', 'shopbuilder' ), ], [ 'cart_table_items' => 'price', 'cart_table_heading_title' => esc_html__( 'Price', 'shopbuilder' ), ], [ 'cart_table_items' => 'quantity', 'cart_table_heading_title' => esc_html__( 'Quantity', 'shopbuilder' ), ], [ 'cart_table_items' => 'subtotal', 'cart_table_heading_title' => esc_html__( 'Total', 'shopbuilder' ), ], ], 'title_field' => '{{{ cart_table_heading_title }}}', ], 'general_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function action_control() { $fields = [ 'action_control_section' => [ 'mode' => 'section_start', 'label' => esc_html__( 'Action ', 'shopbuilder' ), ], 'cart_table_update_button_heading' => [ 'type' => 'html', 'raw' => sprintf( '

%s

', esc_html__( 'Update Button', 'shopbuilder' ) ), 'content_classes' => 'elementor-panel-heading-title', 'separator' => 'default', ], 'cart_table_update_button_text' => [ 'label' => esc_html__( 'Label', 'shopbuilder' ), 'type' => 'text', 'separator' => 'default', 'default' => esc_html__( 'Update Cart', 'shopbuilder' ), 'placeholder' => esc_html__( 'Update Cart', 'shopbuilder' ), ], 'cart_table_coupon_form_heading' => [ 'type' => 'html', 'raw' => sprintf( '

%s

', esc_html__( 'Coupon Form', 'shopbuilder' ) ), 'content_classes' => 'elementor-panel-heading-title', 'separator' => 'before', 'condition' => [ 'show_coupon_field' => 'yes', ], ], 'cart_table_coupon_button_text' => [ 'label' => esc_html__( 'Button Label', 'shopbuilder' ), 'type' => 'text', 'separator' => 'default', 'default' => esc_html__( 'Apply Coupon', 'shopbuilder' ), 'placeholder' => esc_html__( 'Apply Coupon', 'shopbuilder' ), 'condition' => [ 'show_coupon_field' => 'yes', ], ], 'cart_table_coupon_placeholder_text' => [ 'label' => esc_html__( 'Placeholder Text', 'shopbuilder' ), 'type' => 'text', 'default' => esc_html__( 'Coupon Code', 'shopbuilder' ), 'placeholder' => esc_html__( 'Coupon Code', 'shopbuilder' ), 'condition' => [ 'show_coupon_field' => 'yes', ], ], 'action_control_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function notice_style() { $fields = [ 'notice_section' => [ 'mode' => 'section_start', 'tab' => 'style', 'label' => esc_html__( 'Notice ', 'shopbuilder' ), ], 'notice_typography' => [ 'mode' => 'group', 'type' => 'typography', 'label' => esc_html__( 'Typography', 'shopbuilder' ), 'selector' => self::$selectors['notice_typography'], ], 'notice_padding' => [ 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ], 'notice_tabs_start' => [ 'mode' => 'tabs_start', ], // Tab For normal view. 'notice_normal' => [ 'mode' => 'tab_start', 'label' => esc_html__( 'Success Message', 'shopbuilder' ), ], 'notice_bg_color' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'separator' => 'default', 'selectors' => [ self::$selectors['notice_bg_color'] => 'background-color: {{VALUE}};', ], ], 'notice_text_color' => [ 'label' => esc_html__( 'Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['notice_text_color'] => 'color: {{VALUE}};', ], ], 'notice_border_color' => [ 'label' => esc_html__( 'Border Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['notice_border_color'] => 'border-color: {{VALUE}};', ], ], 'notice_normal_end' => [ 'mode' => 'tab_end', ], 'notice_hover' => [ 'mode' => 'tab_start', 'label' => esc_html__( 'Error Messsage', 'shopbuilder' ), ], 'error_notice_bg_color' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'separator' => 'default', 'selectors' => [ self::$selectors['error_notice_bg_color'] => 'background-color: {{VALUE}};', ], ], 'error_notice_text_color' => [ 'label' => esc_html__( 'Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['error_notice_text_color'] => 'color: {{VALUE}};', ], ], 'error_notice_border_color' => [ 'label' => esc_html__( 'Border Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['error_notice_border_color'] => 'border-color: {{VALUE}};', ], ], 'notice_hover_end' => [ 'mode' => 'tab_end', ], 'notice_tabs_end' => [ 'mode' => 'tabs_end', ], 'notice_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function input_style() { $fields = [ 'input_section_start' => [ 'mode' => 'section_start', 'label' => esc_html__( 'Input Field', 'shopbuilder' ), 'tab' => 'style', ], 'quantity_input_width' => [ 'label' => esc_html__( 'Quantity Width', 'shopbuilder' ), 'type' => 'slider', 'separator' => 'default', 'range' => [ 'px' => [ 'min' => 50, 'max' => 100, ], ], 'selectors' => [ self::$selectors['quantity_input_width'] => 'width: {{SIZE}}{{UNIT}};', ], ], 'quantity_input_height' => [ 'label' => esc_html__( 'Quantity Height', 'shopbuilder' ), 'type' => 'slider', 'separator' => 'default', 'range' => [ 'px' => [ 'min' => 10, 'max' => 200, ], ], 'selectors' => [ self::$selectors['quantity_input_height'] => 'height: {{SIZE}}{{UNIT}};', ], ], 'coupon_input_width' => [ 'label' => esc_html__( 'Coupon Width', 'shopbuilder' ), 'type' => 'slider', 'range' => [ 'px' => [ 'min' => 80, 'max' => 500, ], ], 'selectors' => [ self::$selectors['coupon_input_width'] => 'width: {{SIZE}}{{UNIT}} !important;', ], ], 'coupon_input_height' => [ 'label' => esc_html__( 'Coupon Height', 'shopbuilder' ), 'type' => 'slider', 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ self::$selectors['coupon_input_height'] => 'height: {{SIZE}}{{UNIT}} !important;', ], ], 'input_border' => [ 'mode' => 'group', 'type' => 'border', 'selector' => self::$selectors['input_border'], 'size_units' => [ 'px' ], ], 'input_text_color' => [ 'label' => esc_html__( 'Text Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['input_text_color'] => 'color: {{VALUE}};', ], ], 'input_bg_color' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'alpha' => true, 'selectors' => [ self::$selectors['input_bg_color'] => 'background-color: {{VALUE}};', ], ], 'coupon_style_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function cart_empty() { $fields = [ 'empty_notice_section' => [ 'mode' => 'section_start', 'tab' => 'style', 'label' => esc_html__( 'Cart Empty', 'shopbuilder' ), ], 'empty_notice_typography' => [ 'mode' => 'group', 'type' => 'typography', 'label' => esc_html__( 'Typography', 'shopbuilder' ), 'selector' => self::$selectors['empty_notice_typography'], ], 'empty_notice_bg_color' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['empty_notice_bg_color'] => 'background-color: {{VALUE}};', ], ], 'empty_notice_text_color' => [ 'label' => esc_html__( 'Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['empty_notice_text_color'] => 'color: {{VALUE}};', ], ], 'empty_notice_border_color' => [ 'label' => esc_html__( 'Border Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['empty_notice_border_color'] => 'border-color: {{VALUE}};', ], ], 'empty_notice_padding' => [ 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['empty_notice_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ], 'empty_notice_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } /** * Widget Field * * @return array */ public static function return_shop_button_style() { $alignment = ControlHelper::alignment(); unset( $alignment['justify'] ); $fields = [ 'return_shop_button_section_start' => [ 'mode' => 'section_start', 'label' => esc_html__( 'Return Shop Button', 'shopbuilder' ), 'tab' => 'style', ], 'return_shop_button_typography' => [ 'mode' => 'group', 'type' => 'typography', 'label' => esc_html__( 'Typography', 'shopbuilder' ), 'selector' => self::$selectors['return_shop_button_typography'], ], 'return_shop_button_height' => [ 'label' => esc_html__( 'Button Height', 'shopbuilder' ), 'type' => 'slider', 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ self::$selectors['return_shop_button_height'] => 'height: {{SIZE}}{{UNIT}};', ], ], 'return_shop_button_tabs_start' => [ 'mode' => 'tabs_start', ], // Tab For normal view. 'return_shop_button_normal' => [ 'mode' => 'tab_start', 'label' => esc_html__( 'Normal', 'shopbuilder' ), ], 'return_shop_button_text_color_normal' => [ 'label' => esc_html__( 'Color', 'shopbuilder' ), 'type' => 'color', 'separator' => 'default', 'selectors' => [ self::$selectors['return_shop_button_text_color_normal'] => 'color: {{VALUE}};', ], ], 'return_shop_button_bg_color_normal' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['return_shop_button_bg_color_normal'] => 'background-color: {{VALUE}};', ], ], 'return_shop_button_border' => [ 'mode' => 'group', 'type' => 'border', 'selector' => self::$selectors['return_shop_button_border'], 'size_units' => [ 'px' ], ], 'return_shop_button_normal_end' => [ 'mode' => 'tab_end', ], 'return_shop_button_hover' => [ 'mode' => 'tab_start', 'label' => esc_html__( 'Hover', 'shopbuilder' ), ], 'return_shop_button_text_color_hover' => [ 'label' => esc_html__( 'Color', 'shopbuilder' ), 'type' => 'color', 'separator' => 'default', 'selectors' => [ self::$selectors['return_shop_button_text_color_hover'] => 'color: {{VALUE}};', ], ], 'return_shop_button_bg_color_hover' => [ 'label' => esc_html__( 'Background Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['return_shop_button_bg_color_hover'] => 'background-color: {{VALUE}};', ], ], 'return_shop_button_border_hover_color' => [ 'label' => esc_html__( 'Border Color', 'shopbuilder' ), 'type' => 'color', 'selectors' => [ self::$selectors['return_shop_button_border_hover_color'] => 'border-color: {{VALUE}};', ], ], 'return_shop_button_hover_end' => [ 'mode' => 'tab_end', ], 'return_shop_button_tabs_end' => [ 'mode' => 'tabs_end', ], 'return_shop_button_border_radius' => [ 'label' => esc_html__( 'Border Radius (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'separator' => 'before', 'selectors' => [ self::$selectors['return_shop_button_border_radius'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'return_shop_button_padding' => [ 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['return_shop_button_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ], 'return_shop_button_margin' => [ 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), 'type' => 'dimensions', 'size_units' => [ 'px' ], 'selectors' => [ self::$selectors['return_shop_button_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ], 'return_shop_button_section_end' => [ 'mode' => 'section_end', ], ]; return $fields; } }