first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,267 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Category_Count
* Name: Count
* Slug: jet-woo-builder-archive-category-count
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Category_Count extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-category-count';
}
public function get_title() {
return esc_html__( 'Count', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-36';
}
public function get_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/woocommerce-jetwoobuilder-settings-how-to-create-and-set-a-custom-categories-archive-template/?utm_source=need-help&utm_medium=jet-woo-categories&utm_campaign=jetwoobuilder';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'category' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-category-count/css-scheme',
array(
'count' => '.jet-woo-builder-archive-category-count'
)
);
$this->start_controls_section(
'section_general',
array(
'label' => __( 'Content', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_category_count_before_text',
array(
'label' => esc_html__( 'Count Before Text', 'jet-woo-builder' ),
'type' => Controls_Manager::TEXT,
'default' => ! is_rtl() ? '(' : ')',
)
);
$this->add_control(
'archive_category_count_after_text',
array(
'label' => esc_html__( 'Count After Text', 'jet-woo-builder' ),
'type' => Controls_Manager::TEXT,
'default' => ! is_rtl() ? ')' : '(',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_category_count_style',
array(
'label' => esc_html__( 'Count', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'archive_category_count_display',
array(
'label' => esc_html__( 'Count Position', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'block',
'options' => array(
'block' => esc_html__( 'Block', 'jet-woo-builder' ),
'inline-block' => esc_html__( 'Inline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'display: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_category_count_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['count'],
)
);
$this->add_control(
'archive_category_count_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_category_count_bg',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_category_count_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['count'],
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_category_count_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['count'],
)
);
$this->add_control(
'archive_category_count_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_responsive_control(
'archive_category_count_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_count_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['count'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_count_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' => 'text-align: {{VALUE}};',
'{{WRAPPER}} ' . $css_scheme['count'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
/**
* Returns CSS selector for nested element
*
* @param [type] $el [description]
*
* @return [type] [description]
*/
public function css_selector( $el = null ) {
return sprintf( '{{WRAPPER}} .%1$s %2$s', $this->get_name(), $el );
}
public static function render_callback( $settings = array(), $args ) {
$category = ! empty( $args ) ? $args['category'] : get_queried_object();
$count = $category->count;
$before = $settings['count_before_text'];
$after = $settings['count_after_text'];
echo '<div class="jet-woo-builder-archive-category-count">';
echo sprintf( '<span class="jet-woo-category-count">%2$s%1$s%3$s</span>', $count, $before, $after );
echo '</div>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'count_before_text' => ! is_rtl() ? $settings['archive_category_count_before_text'] : $settings['archive_category_count_after_text'],
'count_after_text' => ! is_rtl() ? $settings['archive_category_count_after_text'] : $settings['archive_category_count_before_text'],
);
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name(), $macros_settings );
} else {
echo self::render_callback(
$macros_settings,
jet_woo_builder_integration_woocommerce()->get_current_args()
);
}
}
}

View File

@@ -0,0 +1,256 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Category_Description
* Name: Description
* Slug: jet-woo-builder-archive-category-description
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Category_Description extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-category-description';
}
public function get_title() {
return esc_html__( 'Description', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-35';
}
public function get_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/woocommerce-jetwoobuilder-settings-how-to-create-and-set-a-custom-categories-archive-template/?utm_source=need-help&utm_medium=jet-woo-categories&utm_campaign=jetwoobuilder';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'category' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-category-description/css-scheme',
array(
'description' => '.jet-woo-builder-archive-category-description'
)
);
$this->start_controls_section(
'section_general',
array(
'label' => __( 'Content', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_category_description_desc_length',
array(
'label' => esc_html__( 'Description Words Count', 'jet-woo-builder' ),
'description' => esc_html__( 'Input -1 to show all description and 0 to hide', 'jet-woo-builder' ),
'type' => Controls_Manager::NUMBER,
'min' => - 1,
'default' => 10,
)
);
$this->add_control(
'archive_category_description_after_text',
array(
'label' => esc_html__( 'Trimmed After Text', 'jet-woo-builder' ),
'type' => Controls_Manager::TEXT,
'min' => - 1,
'default' => '...',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_category_description_style',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_category_description_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['description'],
)
);
$this->add_control(
'archive_category_description_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_category_description_bg',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_category_description_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['description'],
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_category_description_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['description'],
)
);
$this->add_control(
'archive_category_description_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_responsive_control(
'archive_category_description_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_description_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_description_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['description'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
/**
* Returns CSS selector for nested element
*
* @param [type] $el [description]
*
* @return [type] [description]
*/
public function css_selector( $el = null ) {
return sprintf( '{{WRAPPER}} .%1$s %2$s', $this->get_name(), $el );
}
public static function render_callback( $settings = array(), $args ) {
$category = ! empty( $args ) ? $args['category'] : get_queried_object();
$description = jet_woo_builder_tools()->trim_text( $category->description, $settings['desc_length'], 'word', $settings['desc_after_text'] );
if ( '' === $description ) {
return false;
}
echo '<div class="jet-woo-builder-archive-category-description">';
echo $description;
echo '</div>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'desc_length' => $settings['archive_category_description_desc_length'],
'desc_after_text' => $settings['archive_category_description_after_text'],
);
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name(), $macros_settings );
} else {
echo self::render_callback(
$macros_settings,
jet_woo_builder_integration_woocommerce()->get_current_args()
);
}
}
}

View File

@@ -0,0 +1,234 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Category_Thumbnail
* Name: Thumbnail
* Slug: jet-woo-builder-archive-category-thumbnail
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Category_Thumbnail extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-category-thumbnail';
}
public function get_title() {
return esc_html__( 'Thumbnail', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-37';
}
public function get_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/woocommerce-jetwoobuilder-settings-how-to-create-and-set-a-custom-categories-archive-template/?utm_source=need-help&utm_medium=jet-woo-categories&utm_campaign=jetwoobuilder';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'category' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-category-thumbnail/css-scheme',
array(
'thumbnail-wrapper' => '.jet-woo-builder-archive-category-thumbnail__wrapper',
'thumbnail' => '.jet-woo-builder-archive-category-thumbnail'
)
);
$this->start_controls_section(
'section_general',
array(
'label' => __( 'Content', 'jet-woo-builder' ),
)
);
$this->add_control(
'is_linked',
array(
'label' => esc_html__( 'Add link to thumbnail', 'jet-woo-builder' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-woo-builder' ),
'label_off' => esc_html__( 'No', 'jet-woo-builder' ),
'return_value' => 'yes',
'default' => '',
)
);
$this->add_control(
'archive_category_thumbnail_size',
array(
'type' => 'select',
'label' => esc_html__( 'Thumbnail Size', 'jet-woo-builder' ),
'default' => 'woocommerce_thumbnail',
'options' => jet_woo_builder_tools()->get_image_sizes(),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_category_thumbnail_style',
array(
'label' => esc_html__( 'Thumbnail', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'archive_category_thumbnail_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnail'] => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_category_thumbnail_border',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnail'],
)
);
$this->add_control(
'archive_category_thumbnail_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnail'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_category_thumbnail_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnail'],
)
);
$this->add_responsive_control(
'archive_category_thumbnail_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnail-wrapper'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_thumbnail_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnail-wrapper'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
/**
* Returns CSS selector for nested element
*
* @param [type] $el [description]
*
* @return [type] [description]
*/
public function css_selector( $el = null ) {
return sprintf( '{{WRAPPER}} .%1$s %2$s', $this->get_name(), $el );
}
public static function render_callback( $settings = array(), $args ) {
$category = !empty( $args ) ? $args['category'] : get_queried_object();
$open_link = '';
$close_link = '';
if ( isset( $settings['is_linked'] ) && 'yes' === $settings['is_linked'] ) {
$open_link = '<a href="' . jet_woo_builder_tools()->get_term_permalink( $category->term_id ) . '">';
$close_link = '</a>';
}
echo '<div class="jet-woo-builder-archive-category-thumbnail__wrapper">';
echo '<div class="jet-woo-builder-archive-category-thumbnail">';
echo $open_link;
echo jet_woo_builder_template_functions()->get_category_thumbnail(
$category->term_id,
$settings['archive_category_thumbnail_size']
);
echo $close_link;
echo '</div>';
echo '</div>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'is_linked' => $settings['is_linked'],
'archive_category_thumbnail_size' => $settings['archive_category_thumbnail_size'],
);
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name(), $macros_settings );
} else {
echo self::render_callback(
$macros_settings,
jet_woo_builder_integration_woocommerce()->get_current_args()
);
}
}
public function add_product_classes() {
}
}

View File

@@ -0,0 +1,315 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Category_Title
* Name: Title
* Slug: jet-woo-builder-archive-category-title
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Category_Title extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-category-title';
}
public function get_title() {
return esc_html__( 'Title', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-34';
}
public function get_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/woocommerce-jetwoobuilder-settings-how-to-create-and-set-a-custom-categories-archive-template/?utm_source=need-help&utm_medium=jet-woo-categories&utm_campaign=jetwoobuilder';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'category' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-category-title/css-scheme',
array(
'title' => '.jet-woo-builder-archive-category-title'
)
);
$this->start_controls_section(
'section_general',
array(
'label' => __( 'Content', 'jet-woo-builder' ),
)
);
$this->add_control(
'is_linked',
array(
'label' => esc_html__( 'Add link to title', 'jet-woo-builder' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'jet-woo-builder' ),
'label_off' => esc_html__( 'No', 'jet-woo-builder' ),
'return_value' => 'yes',
'default' => '',
)
);
$this->add_control(
'title_html_tag',
array(
'label' => esc_html__( 'Title HTML Tag', 'jet-cw' ),
'type' => Controls_Manager::SELECT,
'default' => 'h5',
'options' => jet_woo_builder_tools()->get_available_title_html_tags(),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_category_title_style',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_category_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->start_controls_tabs( 'tabs_archive_category_title_style' );
$this->start_controls_tab(
'tab_archive_category_title_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_category_title_color_normal',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_category_title_bg_normal',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'background-color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_category_title_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_category_title_color_hover',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] . ':hover a' => ' color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_category_title_bg_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] . ':hover' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_category_title_border_hover',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] . ':hover' => 'border-color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_category_title_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_category_title_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_control(
'archive_category_title_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_responsive_control(
'archive_category_title_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_title_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_category_title_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Left', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
/**
* Returns CSS selector for nested element
*
* @param [type] $el [description]
*
* @return [type] [description]
*/
public function css_selector( $el = null ) {
return sprintf( '{{WRAPPER}} .%1$s %2$s', $this->get_name(), $el );
}
public static function render_callback( $settings = array(), $args = [] ) {
$category = !empty( $args ) ? $args['category'] : get_queried_object();
$open_link = '';
$close_link = '';
if ( isset( $settings['is_linked'] ) && 'yes' === $settings['is_linked'] ) {
$open_link = '<a href="' . jet_woo_builder_tools()->get_term_permalink( $category->term_id ) . '">';
$close_link = '</a>';
}
echo '<' . $settings['title_html_tag'] . ' class="jet-woo-builder-archive-category-title">';
echo $open_link;
echo $category->name;
echo $close_link;
echo '</' . $settings['title_html_tag'] . '>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'is_linked' => $settings['is_linked'],
'title_html_tag' => $settings['title_html_tag'],
);
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name(), $macros_settings );
} else {
echo self::render_callback(
$macros_settings,
jet_woo_builder_integration_woocommerce()->get_current_args()
);
}
}
}