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

View File

@@ -0,0 +1,433 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Add_To_Cart
* Name: Add To Cart
* Slug: jet-woo-builder-archive-add-to-cart
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Add_To_Cart extends Jet_Woo_Builder_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-add-to-cart';
}
public function get_title() {
return esc_html__( 'Add to Cart', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-1';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/woocommerce-jetwoobuilder-settings-how-to-create-and-set-a-custom-categories-archive-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-add-to-cart/css-scheme',
array(
'wrapper' => '.jet-woo-builder-archive-add-to-cart',
'button' => '.jet-woo-builder-archive-add-to-cart .button',
)
);
$this->start_controls_section(
'section_archive_add_to_cart_style',
array(
'label' => esc_html__( 'Add To Cart', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_add_to_cart_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_4,
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
'placeholder' => '1px',
)
);
$this->add_responsive_control(
'button_width',
array(
'label' => esc_html__( 'Button Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'%',
'px',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 100,
),
'px' => array(
'min' => 50,
'max' => 1000,
),
),
'default' => array(
'unit' => 'px',
'size' => '',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'width: {{SIZE}}{{UNIT}}',
),
)
);
$this->start_controls_tabs( 'tabs_archive_add_to_cart_style' );
$this->start_controls_tab(
'tab_archive_add_to_cart_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_add_to_cart_text_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_add_to_cart_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_add_to_cart_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_add_to_cart_hover_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_background_hover_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'background-color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'archive_add_to_cart_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . ':hover' => 'border-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_add_to_cart_hover_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . ':hover',
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_add_to_cart_added',
array(
'label' => esc_html__( 'Added', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_add_to_cart_disabled_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.disabled' => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_background_disabled_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.disabled' => 'background-color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_added_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.added' => 'border-color: {{VALUE}};',
'{{WRAPPER}} ' . $css_scheme['button'] . '.added' => 'border-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_add_to_cart_added_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . '.added',
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_add_to_cart_loading',
array(
'label' => esc_html__( 'Loading', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_add_to_cart_loading_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.loading' => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_background_loading_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.loading' => 'background-color: {{VALUE}};',
),
)
);
$this->add_control(
'archive_add_to_cart_loading_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] . '.loading' => 'border-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_add_to_cart_loading_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'] . '.loading',
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_add_to_cart_border',
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['button'],
'separator' => 'before'
)
);
$this->add_control(
'archive_add_to_cart_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_add_to_cart_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['button'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before'
)
);
$this->add_responsive_control(
'archive_add_to_cart_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['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() ) {
global $product;
if ( ! is_a( $product, 'WC_Product' ) ) {
return;
}
$ajax_add_to_cart_enabled = 'yes' === get_option( 'woocommerce_enable_ajax_add_to_cart' ) ? true : false;
$popup_enable = ! empty( $settings['jet_woo_builder_cart_popup'] ) ? esc_attr( $settings['jet_woo_builder_cart_popup'] ) : false;
$popup_id = ! empty( $settings['jet_woo_builder_cart_popup_template'] ) ? esc_attr( $settings['jet_woo_builder_cart_popup_template'] ) : '';
$args['class'] = implode(
' ',
array_filter(
array(
'button',
'product_type_' . $product->get_type(),
$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',
$product->supports( 'ajax_add_to_cart' ) && $product->is_purchasable() && $product->is_in_stock() && $ajax_add_to_cart_enabled ? 'ajax_add_to_cart' : '',
)
)
);
if ( $popup_enable ) {
echo '<div class="jet-woo-builder-archive-add-to-cart" data-cart-popup-enable=' . json_encode( $popup_enable ) . ' data-cart-popup-id=' . $popup_id . ' >';
} else {
echo '<div class="jet-woo-builder-archive-add-to-cart">';
}
woocommerce_template_loop_add_to_cart( $args );
echo '</div>';
}
protected function render() {
$this->__open_wrap();
$settings = $this->get_settings();
$settings = apply_filters( 'jet-woo-builder/jet-woo-archive-add-to-cart/settings', $settings, $this );
$macros_settings = array(
'jet_woo_builder_cart_popup' => json_encode( ! empty( $settings['jet_woo_builder_cart_popup'] ) ? esc_attr( $settings['jet_woo_builder_cart_popup'] ) : false ),
'jet_woo_builder_cart_popup_template' => ! empty( $settings['jet_woo_builder_cart_popup_template'] ) ? esc_attr( $settings['jet_woo_builder_cart_popup_template'] ) : '',
);
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 );
}
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,185 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Cats
* Name: Categories
* Slug: jet-woo-builder-archive-cats
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Cats extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-cats';
}
public function get_title() {
return esc_html__( 'Categories', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-24';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-cats/css-scheme',
array(
'cats' => '.jet-woo-builder-archive-product-cats',
)
);
$this->start_controls_section(
'section_archive_cats_style',
array(
'label' => esc_html__( 'Categories', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_3,
'selector' => '{{WRAPPER}} ' . $css_scheme['cats'] . ' a',
)
);
$this->start_controls_tabs( 'tabs_archive_cats_color' );
$this->start_controls_tab(
'tab_archive_cats_color_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_cats_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['cats'] . ' a' => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['cats'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_cats_color_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_cats_color_hover',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['cats'] . ' a:hover' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'archive_cats_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['cats'] => 'text-align: {{VALUE}};',
),
'separator' => 'before',
'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() {
echo '<div class="jet-woo-builder-archive-product-cats">';
echo jet_woo_builder_template_functions()->get_product_categories_list();
echo '</div>';
}
protected function render() {
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name() );
} else {
echo self::render_callback( );
}
}
}

View File

@@ -0,0 +1,178 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Product_Excerpt
* Name: Excerpt
* Slug: jet-woo-builder-archive-product-excerpt
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Product_Excerpt extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-product-excerpt';
}
public function get_title() {
return esc_html__( 'Excerpt', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-4';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-product-excerpt/css-scheme',
array(
'excerpt' => '.jet-woo-builder-archive-product-excerpt'
)
);
$this->start_controls_section(
'section_archive_excerpt_content',
array(
'label' => esc_html__( 'Content', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_CONTENT,
'show_label' => false,
)
);
$this->add_control(
'archive_excerpt_length',
array(
'type' => 'number',
'label' => esc_html__( 'Excerpt Words Count', 'jet-woo-builder' ),
'min' => 1,
'default' => 10,
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_excerpt_style',
array(
'label' => esc_html__( 'Excerpt', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'archive_excerpt_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['excerpt'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_excerpt_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['excerpt'],
)
);
$this->add_responsive_control(
'archive_excerpt_align',
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',
),
'justify' => array(
'title' => esc_html__( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['excerpt'] => '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() ) {
$excerpt = jet_woo_builder_tools()->trim_text(
jet_woo_builder_template_functions()->get_product_excerpt(),
$settings['archive_excerpt_length'],
'word',
'...'
);
echo '<div class="jet-woo-builder-archive-product-excerpt">';
echo $excerpt;
echo '</div>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'archive_excerpt_length' => $settings['archive_excerpt_length'],
);
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 );
}
}
}

View File

@@ -0,0 +1,459 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Product_Price
* Name: Price
* Slug: jet-woo-builder-archive-product-price
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Product_Price extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-product-price';
}
public function get_title() {
return esc_html__( 'Price', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-7';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-product-price/css-scheme',
array(
'price' => '.jet-woo-product-price',
'currency' => '.jet-woo-product-price .woocommerce-Price-currencySymbol',
)
);
$this->start_controls_section(
'section_archive_price_style',
array(
'label' => esc_html__( 'Price', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_price_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['price'],
)
);
$this->add_control(
'archive_price_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'archive_price_space_between',
array(
'label' => esc_html__( 'Space Between Prices', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 0,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del+ins' => ! is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
),
)
);
$this->start_controls_tabs( 'tabs_archive_price_style' );
$this->start_controls_tab(
'tab_archive_price_regular',
array(
'label' => __( 'Regular', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_price_regular_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .amount' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_price_regular_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'line-through',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del' => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'archive_price_regular_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .amount' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'archive_price_regular_weight',
array(
'label' => esc_html__( 'Font Weight', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => '400',
'options' => array(
'100' => esc_html__( '100', 'jet-woo-builder' ),
'200' => esc_html__( '200', 'jet-woo-builder' ),
'300' => esc_html__( '300', 'jet-woo-builder' ),
'400' => esc_html__( '400', 'jet-woo-builder' ),
'500' => esc_html__( '500', 'jet-woo-builder' ),
'600' => esc_html__( '600', 'jet-woo-builder' ),
'700' => esc_html__( '700', 'jet-woo-builder' ),
'800' => esc_html__( '800', 'jet-woo-builder' ),
'900' => esc_html__( '900', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .amount' => 'font-weight: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_price_sale',
array(
'label' => __( 'Sale', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_price_sale_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .amount' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_price_sale_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .amount' => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'archive_price_sale_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'archive_price_sale_weight',
array(
'label' => esc_html__( 'Font Weight', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => '400',
'options' => array(
'100' => esc_html__( '100', 'jet-woo-builder' ),
'200' => esc_html__( '200', 'jet-woo-builder' ),
'300' => esc_html__( '300', 'jet-woo-builder' ),
'400' => esc_html__( '400', 'jet-woo-builder' ),
'500' => esc_html__( '500', 'jet-woo-builder' ),
'600' => esc_html__( '600', 'jet-woo-builder' ),
'700' => esc_html__( '700', 'jet-woo-builder' ),
'800' => esc_html__( '800', 'jet-woo-builder' ),
'900' => esc_html__( '900', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'font-weight: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'archive_price_item_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['price'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_currency_sign_style',
array(
'label' => esc_html__( 'Currency Sign', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'currency_sign_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'currency_sign_vertical_align',
array(
'label' => esc_html__( 'Vertical Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'baseline' => esc_html__( 'Baseline', 'jet-woo-builder' ),
'top' => esc_html__( 'Top', 'jet-woo-builder' ),
'middle' => esc_html__( 'Middle', 'jet-woo-builder' ),
'bottom' => esc_html__( 'Bottom', 'jet-woo-builder' ),
'sub' => esc_html__( 'Sub', 'jet-woo-builder' ),
'super' => esc_html__( 'Super', 'jet-woo-builder' ),
'text-top' => esc_html__( 'Text Top', 'jet-woo-builder' ),
'text-bottom' => esc_html__( 'Text Bottom', 'jet-woo-builder' ),
),
'default' => 'baseline',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'vertical-align: {{VALUE}};',
),
)
);
$this->start_controls_tabs( 'tabs_currency_sign_style' );
$this->start_controls_tab(
'tab_currency_sign_regular',
array(
'label' => __( 'Regular', 'jet-woo-builder' ),
)
);
$this->add_control(
'currency_sign_color_regular',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .woocommerce-Price-currencySymbol' => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size_regular',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .woocommerce-Price-currencySymbol' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_currency_sign_sale',
array(
'label' => esc_html__( 'Sale', 'jet-woo-builder' ),
)
);
$this->add_control(
'currency_sign_color_sale',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .woocommerce-Price-currencySymbol' => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size_sale',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .woocommerce-Price-currencySymbol' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$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() {
echo '<div class="jet-woo-builder-archive-product-price">';
echo '<div class="jet-woo-product-price">';
echo jet_woo_builder_template_functions()->get_product_price();
echo '</div>';
echo '</div>';
}
protected function render() {
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name() );
} else {
echo self::render_callback();
}
}
}

View File

@@ -0,0 +1,250 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Product_Rating
* Name: Rating
* Slug: jet-woo-builder-archive-product-rating
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Product_Rating extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-product-rating';
}
public function get_title() {
return esc_html__( 'Rating', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-8';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-rating/css-scheme',
array(
'rating' => '.jet-woo-product-rating',
'stars' => '.product-rating__content',
)
);
$this->start_controls_section(
'section_archive_rating_styles',
array(
'label' => esc_html__( 'Rating', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'show_empty_rating',
array(
'label' => esc_html__( 'Show Rating if Empty', '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' => 'true',
'default' => '',
)
);
$this->add_control(
'archive_rating_icon',
array(
'label' => esc_html__( 'Rating Icon', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'jetwoo-front-icon-rating-1',
'options' => jet_woo_builder_tools()->get_available_rating_icons_list(),
)
);
$this->add_responsive_control(
'archive_stars_font_size',
array(
'label' => esc_html__( 'Font Size (px)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 60,
),
),
'default' => array(
'unit' => 'px',
'size' => 16,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->start_controls_tabs( 'tabs_archive_stars_styles' );
$this->start_controls_tab(
'tab_archive_stars_all',
array(
'label' => esc_html__( 'All', 'jet-woo-builder' ),
)
);
$this->add_control(
'stars_archive_color_all',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '#a1a2a4',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_stars_rated',
array(
'label' => esc_html__( 'Rated', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_stars_color_rated',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '#fdbc32',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' > .product-rating__icon.active' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'archive_stars_space_between',
array(
'label' => esc_html__( 'Space Between Stars (px)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 20,
),
),
'default' => array(
'unit' => 'px',
'size' => 2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon + .product-rating__icon' => 'margin-left: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_stars_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['rating'] => '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() ) {
if ( ! isset( $settings['archive_rating_icon'] ) ) {
$settings['archive_rating_icon'] = 'jetwoo-front-icon-rating-1';
}
$empty_rating = ( isset( $settings['show_empty_rating'] ) && 'true' === $settings['show_empty_rating'] ) ? true : false;
$rating = jet_woo_builder_template_functions()->get_product_custom_rating( $settings['archive_rating_icon'], $empty_rating );
if ( false !== $rating ) {
echo '<div class="jet-woo-builder-archive-product-rating">';
echo '<div class="jet-woo-product-rating">';
echo $rating;
echo '</div>';
echo '</div>';
}
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'archive_rating_icon' => $settings['archive_rating_icon'],
'show_empty_rating' => $settings['show_empty_rating'],
);
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 );
}
}
}

View File

@@ -0,0 +1,218 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Product_Thumbnail
* Name: Thumbnail
* Slug: jet-woo-builder-archive-product-thumbnail
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Woo_Builder_Archive_Product_Thumbnail extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-product-thumbnail';
}
public function get_title() {
return esc_html__( 'Thumbnail', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-5';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-product-thumbnail/css-scheme',
array(
'thumbnail-wrapper' => '.jet-woo-builder-archive-product-thumbnail__wrapper',
'thumbnail' => '.jet-woo-builder-archive-product-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 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(
'archive_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_thumbnail_style',
array(
'label' => esc_html__( 'Thumbnail', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'archive_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_thumbnail_border',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnail'],
)
);
$this->add_control(
'archive_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_thumbnail_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnail'],
)
);
$this->add_responsive_control(
'archive_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() ) {
$open_link = '';
$close_link = '';
if ( isset( $settings['is_linked'] ) && 'yes' === $settings['is_linked'] ) {
$open_link = '<a href="' . get_permalink() . '">';
$close_link = '</a>';
}
echo '<div class="jet-woo-builder-archive-product-thumbnail__wrapper">';
echo '<div class="jet-woo-builder-archive-product-thumbnail">';
echo $open_link;
echo jet_woo_builder_template_functions()->get_product_thumbnail(
$settings['archive_thumbnail_size'],
true,
array(
'class' => 'jet-woo-builder-archive-product-image',
'data-no-lazy' => '1',
)
);
echo $close_link;
echo '</div>';
echo '</div>';
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'is_linked' => $settings['is_linked'],
'archive_thumbnail_size' => $settings['archive_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 );
}
}
public function add_product_classes(){
}
}

View File

@@ -0,0 +1,219 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Product_Title
* Name: Title
* Slug: jet-woo-builder-archive-product-title
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Woo_Builder_Archive_Product_Title extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-product-title';
}
public function get_title() {
return esc_html__( 'Title', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-13';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-product-title/css-scheme',
array(
'title' => '.jet-woo-builder-archive-product-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_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_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->start_controls_tabs( 'tabs_archive_title_style' );
$this->start_controls_tab(
'tab_archive_title_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_title_color_normal',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_title_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_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->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'archive_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() ) {
$open_link = '';
$close_link = '';
if ( isset( $settings['is_linked'] ) && 'yes' === $settings['is_linked'] ) {
$open_link = '<a href="' . get_permalink() . '">';
$close_link = '</a>';
}
echo '<' . $settings['title_html_tag'] . ' class="jet-woo-builder-archive-product-title">';
echo $open_link;
echo jet_woo_builder_template_functions()->get_product_title();
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 );
}
}
}

View File

@@ -0,0 +1,239 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Sale_Badge
* Name: Sale Badge
* Slug: jet-woo-builder-archive-sale-badge
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Sale_Badge extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-sale-badge';
}
public function get_title() {
return esc_html__( 'Sale Badge', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-11';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-sale-badge/css-scheme',
array(
'wrapper' => '.jet-woo-builder-archive-product-sale-badge',
'badge' => '.jet-woo-product-badge__sale'
)
);
$this->start_controls_section(
'section_badge_content',
array(
'label' => esc_html__( 'Content', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_CONTENT,
'show_label' => false,
)
);
$this->add_control(
'archive_badge_text',
array(
'type' => 'text',
'label' => esc_html__( 'Sale Badge Text', 'jet-woo-builder' ),
'default' => 'Sale!',
'description' => esc_html__( 'Use %percentage_sale% and %numeric_sale% macros to display a withdrawal of discounts as a percentage or numeric of the initial price.', 'jet-woo-builder' ),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_archive_badge_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'archive_badge_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'archive_badge_background',
array(
'label' => esc_html__( 'Background', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_badge_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'archive_badge_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_responsive_control(
'archive_badge_border_radius',
array(
'label' => __( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'archive_badge_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_responsive_control(
'archive_badge_content_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_badge_content_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['wrapper'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'archive_badge_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['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() ) {
$badge_text = jet_woo_builder()->macros->do_macros( $settings['archive_badge_text'] );
$badge_content = jet_woo_builder_template_functions()->get_product_sale_flash( $badge_text );
if ( null !== $badge_content ){
echo '<div class="jet-woo-builder-archive-product-sale-badge">';
echo $badge_content;
echo '</div>';
}
}
protected function render() {
$settings = $this->get_settings();
$macros_settings = array(
'archive_badge_text' => $settings['archive_badge_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 );
}
}
}

View File

@@ -0,0 +1,174 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Stock_Status
* Name: Stock Status
* Slug: jet-woo-builder-archive-stock-status
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Stock_Status extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-stock-status';
}
public function get_title() {
return esc_html__( 'Stock Status', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-25';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-stock-status/css-scheme',
array(
'stock' => '.jet-woo-builder-archive-product-stock-status .stock',
'in_stock' => '.jet-woo-builder-archive-product-stock-status .in-stock',
'out_of_stock' => '.jet-woo-builder-archive-product-stock-status .out-of-stock',
)
);
$this->start_controls_section(
'section_stock_style',
array(
'label' => esc_html__( 'Stock Status', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'stock_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['stock'],
)
);
$this->start_controls_tabs( 'stock_style_tabs' );
$this->start_controls_tab(
'in_stock_styles',
array(
'label' => esc_html__( 'In Stock', 'jet-woo-builder' ),
)
);
$this->add_control(
'in_stock_color',
array(
'label' => esc_html__( 'In Stock Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['in_stock'] => 'color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'out_of_stock_styles',
array(
'label' => esc_html__( 'Out Of Stock', 'jet-woo-builder' ),
)
);
$this->add_control(
'out_of_stock_color',
array(
'label' => esc_html__( 'Out Of Stock Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['out_of_stock'] => 'color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'stock_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['stock'] => '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() {
echo '<div class="jet-woo-builder-archive-product-stock-status">';
echo jet_woo_builder_template_functions()->get_product_stock_status();
echo '</div>';
}
protected function render() {
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name() );
} else {
echo self::render_callback();
}
}
}

View File

@@ -0,0 +1,185 @@
<?php
/**
* Class: Jet_Woo_Builder_Archive_Tags
* Name: Tags
* Slug: jet-woo-builder-archive-tags
*/
namespace Elementor;
use Elementor\Group_Control_Border;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Archive_Tags extends Widget_Base {
private $source = false;
public function get_name() {
return 'jet-woo-builder-archive-tags';
}
public function get_title() {
return esc_html__( 'Tags', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-22';
}
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( 'archive' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-archive-tags/css-scheme',
array(
'tags' => '.jet-woo-builder-archive-product-tags',
)
);
$this->start_controls_section(
'section_archive_tags_style',
array(
'label' => esc_html__( 'Tags', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'archive_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_3,
'selector' => '{{WRAPPER}} ' . $css_scheme['tags'] . ' a',
)
);
$this->start_controls_tabs( 'tabs_archive_tags_color' );
$this->start_controls_tab(
'tab_archive_tags_color_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_tags_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags'] . ' a' => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $css_scheme['tags'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_archive_tags_color_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'archive_tags_color_hover',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'scheme' => array(
'type' => Scheme_Color::get_type(),
'value' => Scheme_Color::COLOR_2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags'] . ' a:hover' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'archive_tags_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['tags'] => 'text-align: {{VALUE}};',
),
'separator' => 'before',
'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() {
echo '<div class="jet-woo-builder-archive-product-tags">';
echo jet_woo_builder_template_functions()->get_product_tags_list();
echo '</div>';
}
protected function render() {
if ( jet_woo_builder_tools()->is_builder_content_save() ) {
echo jet_woo_builder()->parser->get_macros_string( $this->get_name() );
} else {
echo self::render_callback( );
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,134 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Description
* Name: Products Description
* Slug: jet-woo-builder-products-description
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Description extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-description';
}
public function get_title() {
return esc_html__( 'Products Description', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-26';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/products-result-count/css-scheme',
array(
'term_description' => '.elementor-jet-woo-builder-products-description .term-description',
'archive_description' => '.elementor-jet-woo-builder-products-description .page-description',
)
);
$this->start_controls_section(
'section_products_description_style',
array(
'label' => __( 'Products Description', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'products_description_text_color',
array(
'label' => __( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['term_description'] => 'color: {{VALUE}};',
'{{WRAPPER}} ' . $css_scheme['archive_description'] => 'color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'products_description_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['term_description'] . ',' . '{{WRAPPER}} ' . $css_scheme['archive_description'],
)
);
$this->add_responsive_control(
'products_description_align',
array(
'label' => __( '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',
),
'justify' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['term_description'] => 'text-align: {{VALUE}};',
'{{WRAPPER}} ' . $css_scheme['archive_description'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
woocommerce_taxonomy_archive_description();
woocommerce_product_archive_description();
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,95 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Loop
* Name: Products Loop
* Slug: jet-woo-builder-products-loop
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Loop extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-loop';
}
public function get_title() {
return esc_html__( 'Products Loop', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-27';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
}
public static function products_loop() {
if ( \Elementor\Plugin::$instance->editor->is_edit_mode() || is_product_taxonomy() || is_post_type_archive( 'product' ) || is_page( wc_get_page_id( 'shop' ) ) ) {
if ( woocommerce_product_loop() ) {
woocommerce_product_loop_start();
if ( wc_get_loop_prop( 'total' ) ) {
while ( have_posts() ) {
the_post();
do_action( 'woocommerce_shop_loop' );
wc_get_template_part( 'content', 'product' );
}
}
woocommerce_product_loop_end();
} else {
do_action( 'woocommerce_no_products_found' );
}
}
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
self::products_loop();
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,574 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Navigation
* Name: Products Navigation
* Slug: jet-woo-builder-products-navigation
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Navigation extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-navigation';
}
public function get_title() {
return esc_html__( 'Products Navigation', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-28';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$this->start_controls_section(
'section_general',
array(
'label' => esc_html__( 'Items', 'jet-woo-builder' ),
)
);
$this->add_control(
'info_notice',
array(
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__( 'Works only with main Query object.', 'jet-woo-builder' )
)
);
$this->add_control(
'prev_text',
array(
'label' => esc_html__( 'The previous page link text', 'jet-woo-builder' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Previous', 'jet-woo-builder' ),
)
);
$this->__add_advanced_icon_control(
'prev_icon',
array(
'label' => esc_html__( 'The previous page link icon', 'jet-woo-builder' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-angle-left',
'fa5_default' => array(
'value' => 'fas fa-angle-left',
'library' => 'fa-solid',
),
)
);
$this->add_control(
'next_text',
array(
'label' => esc_html__( 'The next page link text', 'jet-woo-builder' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Next', 'jet-woo-builder' ),
)
);
$this->__add_advanced_icon_control(
'next_icon',
array(
'label' => esc_html__( 'The next page link icon', 'jet-woo-builder' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-angle-right',
'fa5_default' => array(
'value' => 'fas fa-angle-right',
'library' => 'fa-solid',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'general_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'general_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation' => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'general_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-navigation',
)
);
$this->add_control(
'general_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'general_shadow',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-navigation',
)
);
$this->add_responsive_control(
'general_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'general_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'items_style',
array(
'label' => esc_html__( 'Items', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'items_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
'space-between' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'prefix_class' => 'jet-woo-builder-shop-navigation-',
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation' => 'justify-content: {{VALUE}}',
),
)
);
$this->start_controls_tabs( 'tabs_items_style' );
$this->start_controls_tab(
'items_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'items_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'items_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'items_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'items_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'items_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'items_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'items_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'items_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_3,
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-navigation > a',
'exclude' => array(
'text_decoration'
)
)
);
$this->add_responsive_control(
'items_min_width',
array(
'label' => esc_html__( 'Item Min Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 20,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 150,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'min-width: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'default' => array(
'top' => 10,
'right' => 10,
'bottom' => 10,
'left' => 10,
'isLinked' => true,
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'items_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-navigation > a',
)
);
$this->add_responsive_control(
'items_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'icons_style',
array(
'label' => esc_html__( 'Prev/Next Icons', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->start_controls_tabs( 'tabs_icons_style' );
$this->start_controls_tab(
'icons_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'icons_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation .jet-woo-builder-shop-navigation__arrow' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation .jet-woo-builder-shop-navigation__arrow' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'icons_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'icons_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover .jet-woo-builder-shop-navigation__arrow' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover .jet-woo-builder-shop-navigation__arrow' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'items_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a:hover .jet-woo-builder-shop-navigation__arrow' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'items_icon_size',
array(
'label' => esc_html__( 'Icon Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a .jet-woo-builder-shop-navigation__arrow' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'icons_box_size',
array(
'label' => esc_html__( 'Icon Box Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 18,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 150,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a .jet-woo-builder-shop-navigation__arrow' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'icons_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-navigation .jet-woo-builder-shop-navigation__arrow',
)
);
$this->add_responsive_control(
'icons_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation .jet-woo-builder-shop-navigation__arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_icon_gap',
array(
'label' => esc_html__( 'Gap Between Text and Icon', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 20,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a .jet-woo-builder-shop-navigation__arrow.jet-arrow-prev' => ! is_rtl() ? 'margin-right: {{SIZE}}{{UNIT}};' : 'margin-left: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .jet-woo-builder-shop-navigation > a .jet-woo-builder-shop-navigation__arrow.jet-arrow-next' => ! is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$prev_text = isset( $settings['prev_text'] ) ? $settings['prev_text'] : '';
$next_text = isset( $settings['next_text'] ) ? $settings['next_text'] : '';
$prev_icon = $this->__render_icon( 'prev_icon', '%s', '', false );
$next_icon = $this->__render_icon( 'next_icon', '%s', '', false );
if ( ! empty( $prev_icon ) ) {
$prev_text = $this->get_navigation_arrow( 'prev', $prev_icon ) . $prev_text;
}
if ( ! empty( $next_icon ) ) {
$next_text .= $this->get_navigation_arrow( 'next', $next_icon );
}
$this->__open_wrap();
echo '<div class="jet-woo-builder-shop-navigation">';
posts_nav_link( ' ', $prev_text, $next_text );
echo '</div>';
$this->__close_wrap();
}
/**
* Return html for arrows in navigation
*
* @param string $icon
* @param string $arrow
*
* @return string
*/
public function get_navigation_arrow( $arrow = 'next', $icon = '' ) {
$format = apply_filters(
'jet-woo-builder/shop-navigation/arrows-format',
'<span class="jet-arrow-%s jet-woo-builder-shop-navigation__arrow jet-woo-builder-icon">%s</span>'
);
return sprintf( $format, $arrow, $icon );
}
}

View File

@@ -0,0 +1,60 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Notices
* Name: Products Notices
* Slug: jet-woo-builder-products-notices
*/
namespace Elementor;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Notices extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-notices';
}
public function get_title() {
return esc_html__( 'Products Notices', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-30';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
if ( !jet_woo_builder_integration()->in_elementor() ) {
wc_print_notices();
}
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,414 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Ordering
* Name: Products Ordering
* Slug: jet-woo-builder-products-ordering
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Ordering extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-ordering';
}
public function get_title() {
return esc_html__( 'Products Ordering', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-31';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/products-ordering/css-scheme',
array(
'wrapper' => '.elementor-jet-woo-builder-products-ordering',
'ordering_wrapper' => '.elementor-jet-woo-builder-products-ordering .woocommerce-ordering',
'select' => '.elementor-jet-woo-builder-products-ordering .woocommerce-ordering select',
'ordering_arrow' => '.elementor-jet-woo-builder-products-ordering .woocommerce-ordering:before',
)
);
$ordering_arrow = array( '' => esc_html__( 'None', 'jet-woo-builder' ) ) + $this->get_available_down_arrows_list();
$this->start_controls_section(
'section_ordering_select_style',
array(
'label' => esc_html__( 'Ordering Select', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'ordering_select_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['select'],
)
);
$this->add_responsive_control(
'ordering_select_input_width',
array(
'label' => esc_html__( 'Input Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'%',
'px',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 100,
),
'px' => array(
'min' => 50,
'max' => 1000,
),
),
'default' => array(
'unit' => 'px',
'size' => 150,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['ordering_wrapper'] => 'max-width: {{SIZE}}{{UNIT}};',
),
)
);
$this->start_controls_tabs( 'tabs_ordering_select_style' );
$this->start_controls_tab(
'tab_ordering_select_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'ordering_select_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'ordering_select_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] => 'background-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_ordering_select_focus',
array(
'label' => esc_html__( 'Focus', 'jet-woo-builder' ),
)
);
$this->add_control(
'ordering_select_focus_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] . ':focus' => 'color: {{VALUE}};',
),
)
);
$this->add_control(
'ordering_select_focus_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] . ':focus' => 'background-color: {{VALUE}};',
),
)
);
$this->add_control(
'ordering_select_focus_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] . ':focus' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'ordering_select_border',
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['select'],
'separator' => 'before'
)
);
$this->add_control(
'ordering_select_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'ordering_select_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['select'],
)
);
$this->add_responsive_control(
'ordering_select_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
'separator' => 'before'
)
);
$this->add_responsive_control(
'ordering_select_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', 'em', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['select'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'ordering_select_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['wrapper'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_ordering_arrow_style',
array(
'label' => esc_html__( 'Ordering Arrow', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'enable_ordering_arrow',
array(
'label' => esc_html__( 'Show arrow in select', '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' => 'yes',
)
);
$this->add_control(
'ordering_arrow_icon',
array(
'type' => Controls_Manager::SELECT,
'label' => esc_html__( 'Ordering Arrow', 'jet-woo-builder' ),
'default' => 'angle',
'options' => $ordering_arrow,
'condition' => array(
'enable_ordering_arrow' => 'yes',
),
'prefix_class' => 'ordering-select-icon-'
)
);
$this->add_control(
'ordering_arrow_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['ordering_arrow'] => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'ordering_arrow_size',
array(
'label' => esc_html__( 'Arrow Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['ordering_arrow'] => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'ordering_arrow_top_gap',
array(
'label' => esc_html__( 'Top Offset', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'default' => array(
'size' => 9,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['ordering_arrow'] => 'top: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'ordering_arrow_right_gap',
array(
'label' => esc_html__( 'Right Offset', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'default' => array(
'size' => 0,
'unit' => 'px',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['ordering_arrow'] => 'right: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
/**
* Return availbale arrows list
* @return [type] [description]
*/
public function get_available_down_arrows_list() {
return apply_filters(
'jet-woo-builder/product-ordering/select-arrow/icons',
array(
'angle' => __( 'Angle', 'jet-woo-builder' ),
'chevron' => __( 'Chevron', 'jet-woo-builder' ),
'angle-double' => __( 'Angle Double', 'jet-woo-builder' ),
'arrow' => __( 'Arrow', 'jet-woo-builder' ),
'caret' => __( 'Caret', 'jet-woo-builder' ),
'arrow-circle' => __( 'Arrow Circle', 'jet-woo-builder' ),
'chevron-circle' => __( 'Chevron Circle', 'jet-woo-builder' ),
'caret-square' => __( 'Caret Square', 'jet-woo-builder' ),
)
);
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
woocommerce_catalog_ordering();
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,156 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Page_Title
* Name: Page Title
* Slug: jet-woo-builder-products-page-title
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Page_Title extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-page-title';
}
public function get_title() {
return esc_html__( 'Products Page Title', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-32';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/products-page-title/css-scheme',
array(
'page_title' => '.woocommerce-products-header__title.page-title',
)
);
$this->start_controls_section(
'section_page_title_content',
array(
'label' => __( 'Page Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_CONTENT,
)
);
$this->add_control(
'page_title_tag',
array(
'label' => esc_html__( 'Tag', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'h1',
'options' => jet_woo_builder_tools()->get_available_title_html_tags(),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_page_title_style',
array(
'label' => __( 'Page Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'page_title_text_color',
array(
'label' => __( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['page_title'] => 'color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'page_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['page_title'],
)
);
$this->add_responsive_control(
'page_title_align',
array(
'label' => __( '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',
),
'justify' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['page_title'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
}
protected function render() {
$this->__context = 'render';
$settings = $this->get_settings();
$tag = $settings['page_title_tag'];
$this->__open_wrap();
echo '<' . $tag . ' class="woocommerce-products-header__title page-title">';
woocommerce_page_title();
echo '</' . $tag . '>';
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,828 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Pagination
* Name: Products Pagination
* Slug: jet-woo-builder-products-pagination
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Pagination extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-pagination';
}
public function get_title() {
return esc_html__( 'Products Pagination', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-29';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$this->start_controls_section(
'section_general',
array(
'label' => esc_html__( 'Items', 'jet-woo-builder' ),
)
);
$this->add_control(
'info_notice',
array(
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__( 'Works only with main Query object.', 'jet-woo-builder' )
)
);
$this->add_control(
'prev_next',
array(
'label' => esc_html__( 'Add the previous and next page links.', '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' => 'yes',
)
);
$this->add_control(
'prev_text',
array(
'label' => esc_html__( 'The previous page link text', 'jet-woo-builder' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Previous', 'jet-woo-builder' ),
'condition' => array(
'prev_next' => 'yes',
),
)
);
$this->__add_advanced_icon_control(
'prev_icon',
array(
'label' => esc_html__( 'The next page link icon', 'jet-woo-builder' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-angle-left',
'fa5_default' => array(
'value' => 'fas fa-angle-left',
'library' => 'fa-solid',
),
'condition' => array(
'prev_next' => 'yes',
),
)
);
$this->add_control(
'next_text',
array(
'label' => esc_html__( 'The next page text', 'jet-woo-builder' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'default' => esc_html__( 'Next', 'jet-woo-builder' ),
'condition' => array(
'prev_next' => 'yes',
),
)
);
$this->__add_advanced_icon_control(
'next_icon',
array(
'label' => esc_html__( 'The next page link icon', 'jet-woo-builder' ),
'type' => Controls_Manager::ICON,
'label_block' => true,
'file' => '',
'default' => 'fa fa-angle-right',
'fa5_default' => array(
'value' => 'fas fa-angle-right',
'library' => 'fa-solid',
),
'condition' => array(
'prev_next' => 'yes',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'general_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'general_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination' => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'general_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination',
)
);
$this->add_control(
'general_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}; overflow:hidden;',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'general_shadow',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination',
)
);
$this->add_responsive_control(
'general_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'general_margin',
array(
'label' => esc_html__( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'items_style',
array(
'label' => esc_html__( 'Items', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'items_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'flex-start',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Start', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'End', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination' => 'justify-content: {{VALUE}}',
),
)
);
$this->start_controls_tabs( 'tabs_items_style' );
$this->start_controls_tab(
'items_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'items_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'items_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'items_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'items_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'items_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'items_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'items_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'items_active',
array(
'label' => esc_html__( 'Current', 'jet-woo-builder' ),
)
);
$this->add_control(
'items_bg_color_active',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination span.page-numbers.current' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'items_color_active',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination span.page-numbers.current' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'items_active_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'items_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination span.page-numbers.current' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'items_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_3,
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers',
'exclude' => array(
'text_decoration'
)
)
);
$this->add_responsive_control(
'items_min_width',
array(
'label' => esc_html__( 'Item Min Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 20,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 150,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers' => 'min-width: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'default' => array(
'top' => 10,
'right' => 10,
'bottom' => 10,
'left' => 10,
'isLinked' => true,
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_margin',
array(
'label' => esc_html__( 'Gap Between Items', 'jet-woo-builder' ),
'label_block' => true,
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 4,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 50,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers' => 'margin-left: calc( {{SIZE}}px / 2 ); margin-right: calc( {{SIZE}}px / 2 );',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'items_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers:not(.dots)',
)
);
$this->add_responsive_control(
'items_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
$this->section_prev_next_styles();
$this->start_controls_section(
'icons_style',
array(
'label' => esc_html__( 'Prev/Next Icons', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->start_controls_tabs( 'tabs_icons_style' );
$this->start_controls_tab(
'icons_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'icons_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .jet-woo-builder-shop-pagination__arrow' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .jet-woo-builder-shop-pagination__arrow' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'icons_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'icons_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover .jet-woo-builder-shop-pagination__arrow' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover .jet-woo-builder-shop-pagination__arrow' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'icons_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'items_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers:hover .jet-woo-builder-shop-pagination__arrow' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'items_icon_size',
array(
'label' => esc_html__( 'Icon Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 10,
'max' => 100,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers .jet-woo-builder-shop-pagination__arrow' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'icons_box_size',
array(
'label' => esc_html__( 'Icon Box Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 18,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 150,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers .jet-woo-builder-shop-pagination__arrow' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'icons_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination .jet-woo-builder-shop-pagination__arrow',
)
);
$this->add_responsive_control(
'icons_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .jet-woo-builder-shop-pagination__arrow' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'items_icon_gap',
array(
'label' => esc_html__( 'Gap Between Text and Icon', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 20,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers .jet-woo-builder-shop-pagination__arrow.jet-arrow-prev' => ! is_rtl() ? 'margin-right: {{SIZE}}{{UNIT}};' : 'margin-left: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers .jet-woo-builder-shop-pagination__arrow.jet-arrow-next' => ! is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
protected function render() {
if ( ! wc_get_loop_prop( 'is_paginated' ) || ! woocommerce_products_will_display() ) {
return false;
}
$settings = $this->get_settings();
$prev_next = isset( $settings['prev_next'] ) ? $settings['prev_next'] : '';
$prev_next = filter_var( $prev_next, FILTER_VALIDATE_BOOLEAN );
$prev_text = isset( $settings['prev_text'] ) ? $settings['prev_text'] : '';
$next_text = isset( $settings['next_text'] ) ? $settings['next_text'] : '';
$prev_icon = $this->__render_icon( 'prev_icon', '%s', '', false );
$next_icon = $this->__render_icon( 'next_icon', '%s', '', false );
$total = wc_get_loop_prop( 'total_pages' );
$current = wc_get_loop_prop( 'current_page' );
$base = esc_url_raw( add_query_arg( 'product-page', '%#%', false ) );
$format = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) );
if ( ! wc_get_loop_prop( 'is_shortcode' ) ) {
$format = '';
$base = esc_url_raw( str_replace( 999999999, '%#%', remove_query_arg( 'add-to-cart', get_pagenum_link( 999999999, false ) ) ) );
}
if ( $total <= 1 ) {
return false;
}
$this->__context = 'render';
$this->__open_wrap();
if ( ! empty( $prev_icon ) ) {
$prev_text = $this->get_pagination_arrow( 'prev', $prev_icon ) . $prev_text;
}
if ( ! empty( $next_icon ) ) {
$next_text .= $this->get_pagination_arrow( 'next', $next_icon );
}
echo '<nav class="jet-woo-builder-shop-pagination">';
echo paginate_links( array(
'base' => $base,
'format' => $format,
'prev_next' => $prev_next,
'prev_text' => $prev_text,
'next_text' => $next_text,
'current' => max( 1, $current ),
'total' => $total,
'type' => 'plain',
'end_size' => 3,
'mid_size' => 3,
) );
echo '</nav>';
$this->__close_wrap();
}
/**
* Return html for arrows in pagination
*
* @param string $icon
* @param string $arrow
*
* @return string
*/
public function get_pagination_arrow( $arrow = 'next', $icon = '' ) {
$format = apply_filters(
'jet-woo-builder/shop-pagination/arrows-format',
'<span class="jet-arrow-%s jet-woo-builder-shop-pagination__arrow jet-woo-builder-icon">%s</span>'
);
return sprintf( $format, $arrow, $icon );
}
public function section_prev_next_styles(){
$this->start_controls_section(
'prev_next_style',
array(
'label' => esc_html__( 'Prev/Next', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->start_controls_tabs( 'tabs_prev_next_style' );
$this->start_controls_tab(
'prev_next_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'prev_next_bg_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.prev' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.next' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'prev_next_color',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.prev' => 'color: {{VALUE}}',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.next' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'prev_next_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'prev_next_bg_color_hover',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.prev:hover' => 'background-color: {{VALUE}}',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.next:hover' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'prev_next_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.next:hover' => 'color: {{VALUE}}',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.prev:hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'prev_next_hover_border_color',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'condition' => array(
'prev_next_border_border!' => '',
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.prev:hover' => 'border-color: {{VALUE}};',
'{{WRAPPER}} .jet-woo-builder-shop-pagination a.page-numbers.next:hover' => 'border-color: {{VALUE}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'prev_next_min_width',
array(
'label' => esc_html__( 'Item Min Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'default' => array(
'unit' => 'px',
'size' => 20,
),
'range' => array(
'px' => array(
'min' => 0,
'max' => 150,
),
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.prev' => 'min-width: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.next' => 'min-width: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'prev_next_padding',
array(
'label' => esc_html__( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%', 'em' ),
'default' => array(
'top' => 10,
'right' => 10,
'bottom' => 10,
'left' => 10,
'isLinked' => true,
),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.prev' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.next' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'prev_next_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.prev,' . '{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.next',
)
);
$this->add_responsive_control(
'prev_next_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.prev' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
'{{WRAPPER}} .jet-woo-builder-shop-pagination .page-numbers.next' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
}

View File

@@ -0,0 +1,131 @@
<?php
/**
* Class: Jet_Woo_Builder_Products_Result_Count
* Name: Products Result Count
* Slug: jet-woo-builder-products-result-count
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Products_Result_Count extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-woo-builder-products-result-count';
}
public function get_title() {
return esc_html__( 'Products Result Count', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-33';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-shop-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'shop' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/products-result-count/css-scheme',
array(
'result_count' => '.elementor-jet-woo-builder-products-result-count .woocommerce-result-count',
)
);
$this->start_controls_section(
'section_result_count_style',
array(
'label' => __( 'Result Count', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'result_count_text_color',
array(
'label' => __( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['result_count'] => 'color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'result_count_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['result_count'],
)
);
$this->add_responsive_control(
'result_count_align',
array(
'label' => __( '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',
),
'justify' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['result_count'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
$this->__open_wrap();
woocommerce_result_count();
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,458 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Attributes
* Name: Single Attributes
* Slug: jet-single-attributes
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Attributes extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-attributes';
}
public function get_title() {
return esc_html__( 'Single Attributes', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-2';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-attributes/css-scheme',
array(
'title' => '.jet-woo-builder .jet-single-attrs__title',
'attributes_table' => '.jet-woo-builder .shop_attributes',
'attributes_title' => '.jet-woo-builder .shop_attributes tr > th',
'attributes_value' => '.jet-woo-builder .shop_attributes tr > td',
)
);
$this->start_controls_section(
'section_attrs_content',
array(
'label' => esc_html__( 'Content', 'jet-woo-builder' ),
)
);
$this->add_control(
'block_title',
array(
'label' => esc_html__( 'Title Text', 'jet-woo-builder' ),
'type' => Controls_Manager::TEXT,
)
);
$this->add_control(
'block_title_tag',
array(
'label' => esc_html__( 'Title Tag', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'h2',
'options' => jet_woo_builder_tools()->get_available_title_html_tags(),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_attrs_title_style',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'attrs_title_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'attrs_title_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_responsive_control(
'attrs_title_margin',
array(
'label' => __( '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(
'attrs_title_padding',
array(
'label' => __( '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(
'attrs_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();
$this->start_controls_section(
'section_attrs_table_style',
array(
'label' => esc_html__( 'Attributes table', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_responsive_control(
'section_attrs_table_width',
array(
'label' => esc_html__( 'Table Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px',
'%',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 100,
),
'px' => array(
'min' => 100,
'max' => 500,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_table'] => 'max-width: {{SIZE}}{{UNIT}}',
),
)
);
$this->add_control(
'heading_attrs_table_title',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_control(
'attrs_table_title_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_title'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'attrs_table_title_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['attributes_title'],
)
);
$this->add_control(
'attrs_table_title_background',
array(
'label' => __( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_title'] => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'attrs_table_title_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['attributes_title'],
'fields_options' => array(
'border' => array(
'default' => 'solid',
),
'width' => array(
'default' => array(
'top' => '1',
'right' => '1',
'bottom' => '1',
'left' => '1',
'isLinked' => true,
),
),
'color' => array(),
),
)
);
$this->add_responsive_control(
'attrs_table_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['attributes_title'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'attrs_table_title_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_title'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'attrs_table_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['attributes_title'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->add_control(
'heading_attrs_table_value',
array(
'label' => esc_html__( 'Value', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_control(
'attrs_table_value_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_value'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'attrs_table_value_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['attributes_value'],
)
);
$this->add_control(
'attrs_table_value_background',
array(
'label' => __( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_value'] => 'background-color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'attrs_table_value_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['attributes_value'],
'fields_options' => array(
'border' => array(
'default' => 'solid',
),
'width' => array(
'default' => array(
'top' => '1',
'right' => '1',
'bottom' => '1',
'left' => '1',
'isLinked' => true,
),
),
'color' => array(),
),
)
);
$this->add_responsive_control(
'attrs_table_value_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_value'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'attrs_table_value_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['attributes_value'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'attrs_table_value_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['attributes_value'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Content
* Name: Single Content
* Slug: jet-single-content
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Content extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-content';
}
public function get_title() {
return esc_html__( 'Single Content', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-3';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-content/css-scheme',
array(
'content_wrapper' => '.jet-woo-builder .jet-single-content'
)
);
$this->start_controls_section(
'section_single_content_style',
array(
'label' => __( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'single_content_text_color',
array(
'label' => __( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'color: {{VALUE}};',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
)
);
$this->add_responsive_control(
'single_content_align',
array(
'label' => __( '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',
),
'justify' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,137 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Excerpt
* Name: Single Excerpt
* Slug: jet-single-excerpt
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Excerpt extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-excerpt';
}
public function get_title() {
return esc_html__( 'Single Excerpt', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-4';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-excerpt/css-scheme',
array(
'excerpt' => '.jet-woo-builder .woocommerce-product-details__short-description'
)
);
$this->start_controls_section(
'section_single_excerpt_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'single_excerpt_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['excerpt'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_excerpt_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['excerpt'],
)
);
$this->add_responsive_control(
'single_excerpt_align',
array(
'label' => __( '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',
),
'justify' => array(
'title' => __( 'Justified', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['excerpt'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,310 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Images
* Name: Single Images
* Slug: jet-single-images
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Images extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-images';
}
public function get_title() {
return esc_html__( 'Single Images', 'jet-woo-builder' );
}
public function get_script_depends() {
return array( 'flexslider', 'zoom', 'wc-single-product' );
}
public function get_icon() {
return 'jetwoobuilder-icon-5';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-images/css-scheme',
array(
'images' => '.jet-woo-builder .jet-single-images__wrap div.images',
'main_image' => '.jet-woo-builder .jet-single-images__wrap .woocommerce-product-gallery > .flex-viewport',
'thumbnails_wrapper' => '.jet-woo-builder .jet-single-images__wrap .flex-control-thumbs',
'thumbnails_h_wrapper' => '.jet-woo-builder .jet-single-images__wrap:not(.jet-single-images-nav-vertical) .flex-control-thumbs',
'thumbnails' => '.jet-woo-builder .jet-single-images__wrap .flex-control-thumbs > li',
'thumbnails_img' => '.jet-woo-builder .jet-single-images__wrap .flex-control-thumbs > li > img'
)
);
$this->start_controls_section(
'section_single_main_image_style',
array(
'label' => esc_html__( 'Main Image', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'main_image_description',
array(
'raw' => esc_html__( 'This controls works only with main gallery image.', 'jet-woo-builder' ),
'type' => Controls_Manager::RAW_HTML,
'content_classes' => 'elementor-descriptor',
)
);
$this->add_control(
'main_image_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['main_image'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'main_image_width',
array(
'label' => esc_html__( 'Images Block Width (%)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( '%' ),
'range' => array(
'%' => array(
'min' => 0,
'max' => 100,
),
),
'default' => array(
'unit' => '%',
'size' => 100,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['images'] => 'width: {{SIZE}}% !important; float: none !important;',
),
)
);
$this->add_responsive_control(
'main_image_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['main_image'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'main_image_border',
'selector' => '{{WRAPPER}} ' . $css_scheme['main_image'],
)
);
$this->add_responsive_control(
'main_image_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['main_image'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'main_image_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['main_image'],
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_single_image_thumbnails_style',
array(
'label' => esc_html__( 'Thumbnails', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'control_nav_direction',
array(
'label' => esc_html__( 'Direction:', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'horizontal',
'options' => array(
'vertical' => esc_html__( 'Vertical', 'jet-woo-builder' ),
'horizontal' => esc_html__( 'Horizontal', 'jet-woo-builder' ),
),
)
);
$this->add_control(
'control_nav_v_position',
array(
'label' => esc_html__( 'Position :', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Start', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'right' => array(
'title' => esc_html__( 'End', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'condition' => array(
'control_nav_direction' => 'vertical'
),
)
);
$this->add_control(
'image_thumbnails_background_color',
array(
'label' => esc_html__( 'Background Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnails'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'image_thumbnails_width',
array(
'label' => esc_html__( 'Thumbnails Width (%)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( '%' ),
'range' => array(
'%' => array(
'min' => 0,
'max' => 100,
),
),
'default' => array(
'unit' => '%',
'size' => 11,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnails'] => 'width: {{SIZE}}%;',
),
)
);
$this->add_responsive_control(
'image_thumbnails_padding',
array(
'label' => __( 'Padding(%)', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnails'] => 'padding: {{TOP}}% {{RIGHT}}% {{BOTTOM}}% {{LEFT}}%; margin:0!important;',
'{{WRAPPER}} ' . $css_scheme['thumbnails_h_wrapper'] => 'margin-left: -{{LEFT}}%; margin-right: -{{RIGHT}}%;',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'image_thumbnails_border',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnails_img'],
)
);
$this->add_responsive_control(
'image_thumbnails_border_radius',
array(
'label' => esc_html__( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['thumbnails_img'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'image_thumbnails_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['thumbnails_img'],
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
global $product;
$product = wc_get_product();
if ( empty( $product ) ) {
return;
}
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
// On render widget from Editor - trigger the init manually.
if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) { ?>
<script>
jQuery( '.woocommerce-product-gallery' ).each( function() {
jQuery( this ).wc_product_gallery();
} );
</script>
<?php
}
}
}

View File

@@ -0,0 +1,487 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Meta
* Name: Single Meta
* Slug: jet-single-meta
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Meta extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-meta';
}
public function get_title() {
return esc_html__( 'Single Meta', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-6';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-meta/css-scheme',
array(
'sku' => '.jet-woo-builder .product_meta .sku_wrapper',
'sku_value' => '.jet-woo-builder .product_meta .sku_wrapper .sku',
'categories' => '.jet-woo-builder .product_meta .posted_in',
'categories_link' => '.jet-woo-builder .product_meta .posted_in a',
'tags' => '.jet-woo-builder .product_meta .tagged_as',
'tags_link' => '.jet-woo-builder .product_meta .tagged_as a'
)
);
$this->start_controls_section(
'section_sku_styles',
array(
'label' => esc_html__( 'SKU', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'sku_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sku'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'sku_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['sku'],
)
);
$this->add_responsive_control(
'sku_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sku'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'sku__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['sku'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->add_control(
'heading_sku_value_styles',
array(
'label' => esc_html__( 'Value', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_control(
'sku_value_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['sku_value'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'sku_value_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['sku_value'],
)
);
$this->end_controls_section();
/**
* Categories Style Section
*/
$this->start_controls_section(
'section_categories_styles',
array(
'label' => esc_html__( 'Categories', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'categories_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['categories'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'categories_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['categories'],
)
);
$this->add_responsive_control(
'categories_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['categories'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'categories_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['categories'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->add_control(
'heading_link_categories_styles',
array(
'label' => esc_html__( 'Link', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'categories_link_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['categories_link'],
)
);
$this->start_controls_tabs( 'tabs_categories_link_style' );
$this->start_controls_tab(
'tab_categories_link_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'categories_link_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['categories_link'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_categories_link_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'categories_link_hover_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['categories_link'] . ':hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'categories_link_hover_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['categories_link'] . ':hover' => 'text-decoration: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
/**
* Tags Style Section
*/
$this->start_controls_section(
'section_tags_styles',
array(
'label' => esc_html__( 'Tags', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'tags_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tags_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['tags'],
)
);
$this->add_responsive_control(
'tags_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'tags_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['tags'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->add_control(
'heading_link_tags_styles',
array(
'label' => esc_html__( 'Link', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'tags_link_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['tags_link'],
)
);
$this->start_controls_tabs( 'tabs_tags_link_style' );
$this->start_controls_tab(
'tab_tags_link_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'tags_link_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags_link'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_tags_link_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'tags_link_hover_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags_link'] . ':hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'tags_link_hover_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tags_link'] . ':hover' => 'text-decoration: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
global $product;
$product = wc_get_product();
if ( empty( $product ) ) {
return;
}
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,453 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Price
* Name: Single Price
* Slug: jet-single-price
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Price extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-price';
}
public function get_title() {
return esc_html__( 'Single Price', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-7';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-price/css-scheme',
array(
'price' => '.jet-woo-builder.elementor-jet-single-price .price',
'currency' => '.jet-woo-builder.elementor-jet-single-price .price .woocommerce-Price-currencySymbol',
)
);
$this->start_controls_section(
'section_single_price_style',
array(
'label' => esc_html__( 'Price', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_price_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['price'],
)
);
$this->add_control(
'single_price_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'single_price_space_between',
array(
'label' => esc_html__( 'Space Between Prices', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 0,
'max' => 200,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del+ins' => ! is_rtl() ? 'margin-left: {{SIZE}}{{UNIT}};' : 'margin-right: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'single_price_item_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['price'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->start_controls_tabs( 'tabs_single_price_style' );
$this->start_controls_tab(
'tab_single_price_regular',
array(
'label' => __( 'Regular', 'jet-woo-builder' ),
)
);
$this->add_control(
'single_price_regular_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_price_regular_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'line-through',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del' => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'single_price_regular_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'single_price_regular_weight',
array(
'label' => esc_html__( 'Font Weight', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => '400',
'options' => array(
'100' => esc_html__( '100', 'jet-woo-builder' ),
'200' => esc_html__( '200', 'jet-woo-builder' ),
'300' => esc_html__( '300', 'jet-woo-builder' ),
'400' => esc_html__( '400', 'jet-woo-builder' ),
'500' => esc_html__( '500', 'jet-woo-builder' ),
'600' => esc_html__( '600', 'jet-woo-builder' ),
'700' => esc_html__( '700', 'jet-woo-builder' ),
'800' => esc_html__( '800', 'jet-woo-builder' ),
'900' => esc_html__( '900', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del' => 'font-weight: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_single_price_sale',
array(
'label' => __( 'Sale', 'jet-woo-builder' ),
)
);
$this->add_control(
'single_price_sale_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_price_sale_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'single_price_sale_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'single_price_sale_weight',
array(
'label' => esc_html__( 'Font Weight', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => '400',
'options' => array(
'100' => esc_html__( '100', 'jet-woo-builder' ),
'200' => esc_html__( '200', 'jet-woo-builder' ),
'300' => esc_html__( '300', 'jet-woo-builder' ),
'400' => esc_html__( '400', 'jet-woo-builder' ),
'500' => esc_html__( '500', 'jet-woo-builder' ),
'600' => esc_html__( '600', 'jet-woo-builder' ),
'700' => esc_html__( '700', 'jet-woo-builder' ),
'800' => esc_html__( '800', 'jet-woo-builder' ),
'900' => esc_html__( '900', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins' => 'font-weight: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
$this->start_controls_section(
'section_currency_sign_style',
array(
'label' => esc_html__( 'Currency Sign', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'currency_sign_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_control(
'currency_sign_vertical_align',
array(
'label' => esc_html__( 'Vertical Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'baseline' => esc_html__( 'Baseline', 'jet-woo-builder' ),
'top' => esc_html__( 'Top', 'jet-woo-builder' ),
'middle' => esc_html__( 'Middle', 'jet-woo-builder' ),
'bottom' => esc_html__( 'Bottom', 'jet-woo-builder' ),
'sub' => esc_html__( 'Sub', 'jet-woo-builder' ),
'super' => esc_html__( 'Super', 'jet-woo-builder' ),
'text-top' => esc_html__( 'Text Top', 'jet-woo-builder' ),
'text-bottom' => esc_html__( 'Text Bottom', 'jet-woo-builder' ),
),
'default' => 'baseline',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['currency'] => 'vertical-align: {{VALUE}};',
),
)
);
$this->start_controls_tabs( 'tabs_currency_sign_style' );
$this->start_controls_tab(
'tab_currency_sign_regular',
array(
'label' => __( 'Regular', 'jet-woo-builder' ),
)
);
$this->add_control(
'currency_sign_color_regular',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .woocommerce-Price-currencySymbol' => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size_regular',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' del .woocommerce-Price-currencySymbol' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_currency_sign_sale',
array(
'label' => __( 'Sale', 'jet-woo-builder' ),
)
);
$this->add_control(
'currency_sign_color_sale',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .woocommerce-Price-currencySymbol' => 'color: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'currency_sign_size_sale',
array(
'label' => esc_html__( 'Size', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'range' => array(
'px' => array(
'min' => 6,
'max' => 90,
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['price'] . ' ins .woocommerce-Price-currencySymbol' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
global $product;
$product = wc_get_product();
if ( empty( $product ) ) {
return;
}
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,393 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Rating
* Name: Single Rating
* Slug: jet-single-rating
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Rating extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-rating';
}
public function get_title() {
return esc_html__( 'Single Rating', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-8';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-rating/css-scheme',
array(
'rating_wrapper' => '.jet-woo-builder .woocommerce-product-rating',
'stars' => '.jet-woo-builder.elementor-jet-single-rating .product-rating__content',
'reviews_link' => '.jet-woo-builder .woocommerce-review-link',
)
);
$this->start_controls_section(
'section_rating_styles',
array(
'label' => esc_html__( 'Rating', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'show_single_empty_rating',
array(
'label' => esc_html__( 'Show Rating if Empty', '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' => 'true',
'default' => '',
)
);
$this->add_control(
'rating_icon',
array(
'label' => esc_html__( 'Rating Icon', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'jetwoo-front-icon-rating-1',
'options' => jet_woo_builder_tools()->get_available_rating_icons_list(),
)
);
$this->add_control(
'rating_direction',
array(
'label' => esc_html__( 'Elements display', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'row',
'options' => array(
'column' => esc_html__( 'Block', 'jet-woo-builder' ),
'row' => esc_html__( 'Inline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['rating_wrapper'] => 'flex-direction: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'rating_alignment_horizontal',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'condition' => array(
'rating_direction' => 'row',
),
'default' => 'left',
'options' => array(
'flex-start' => 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',
),
'flex-end' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-right',
),
'space-between' => array(
'title' => esc_html__( 'Justify', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['rating_wrapper'] => 'justify-content: {{VALUE}}; align-items: flex-start;',
),
'classes' => 'elementor-control-align',
)
);
$this->add_responsive_control(
'rating_alignment_vertical',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'condition' => array(
'rating_direction' => 'column',
),
'default' => 'left',
'options' => array(
'flex-start' => array(
'title' => esc_html__( 'Left', 'jet-woo-builder' ),
'icon' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'fa fa-align-center',
),
'flex-end' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'fa fa-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['rating_wrapper'] => 'align-items: {{VALUE}};',
),
)
);
$this->add_control(
'heading_stars_styles',
array(
'label' => esc_html__( 'Stars', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->start_controls_tabs( 'tabs_stars_styles' );
$this->start_controls_tab(
'tab_stars_all',
array(
'label' => esc_html__( 'All', 'jet-woo-builder' ),
)
);
$this->add_control(
'stars_color_all',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '#e7e8e8',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_stars_rated',
array(
'label' => esc_html__( 'Rated', 'jet-woo-builder' ),
)
);
$this->add_control(
'stars_color_rated',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'default' => '#fdbc32',
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon.active' => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'stars_font_size',
array(
'label' => esc_html__( 'Font Size (px)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 60,
),
),
'default' => array(
'unit' => 'px',
'size' => 16,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon' => 'font-size: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'stars_space_between',
array(
'label' => esc_html__( 'Space Between Stars (px)', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array( 'px' ),
'range' => array(
'px' => array(
'min' => 0,
'max' => 20,
),
),
'default' => array(
'unit' => 'px',
'size' => 2,
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] . ' .product-rating__icon + .product-rating__icon' => 'margin-left: {{SIZE}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'stars_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['stars'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_control(
'heading_reviews_link_styles',
array(
'label' => esc_html__( 'Reviews Link', 'jet-woo-builder' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'reviews_link_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['reviews_link'],
)
);
$this->start_controls_tabs( 'tabs_reviews_link_styles' );
$this->start_controls_tab(
'tab_reviews_link_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'reviews_link_color_normal',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['reviews_link'] => 'color: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_reviews_link_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'reviews_link_color_hover',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['reviews_link'] . ':hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'reviews_link_decoration',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
'overline' => esc_html__( 'Overline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['reviews_link'] . ':hover' => 'text-decoration: {{VALUE}}',
),
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'reviews_link_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['reviews_link'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,146 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Related
* Name: Single Related Products
* Slug: jet-single-related
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Related extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-related';
}
public function get_title() {
return esc_html__( 'Single Related Products', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-9';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-related/css-scheme',
array(
'title' => '.jet-woo-builder > .related.products > h2'
)
);
$this->start_controls_section(
'section_single_related_style',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'single_related_title_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_related_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_responsive_control(
'single_related_title_margin',
array(
'label' => __( '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(
'single_related_title_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'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();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
remove_filter( 'woocommerce_product_loop_start', 'woocommerce_maybe_show_product_subcategories' );
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Reviews_Form
* Name: Single Reviews Form
* Slug: jet-single-reviews-form
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Reviews_Form extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-reviews-form';
}
public function get_title() {
return esc_html__( 'Single Reviews Form', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-10';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
$elementor = Plugin::instance();
$is_edit_mode = $elementor->editor->is_edit_mode();
if ( $is_edit_mode ) {
add_filter( 'comments_template', array( 'WC_Template_Loader', 'comments_template_loader' ) );
}
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,207 @@
<?php
/**
* Class: Jet_Woo_Builder_Sale_Badge
* Name: Single Sale Badge
* Slug: jet-single-sale-badge
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Sale_Badge extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-sale-badge';
}
public function get_title() {
return esc_html__( 'Single Sale Badge', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-11';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-sale-badge/css-scheme',
array(
'badge' => '.jet-woo-builder .onsale'
)
);
$this->start_controls_section(
'section_badge_content',
array(
'label' => esc_html__( 'Content', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_CONTENT,
'show_label' => false,
)
);
$this->add_control(
'single_badge_text',
array(
'type' => 'text',
'label' => esc_html__( 'Sale Badge Text', 'jet-woo-builder' ),
'default' => 'Sale!',
'description' => esc_html__( 'Use %percentage_sale% and %numeric_sale% macros to display a withdrawal of discounts as a percentage or numeric of the initial price.', 'jet-woo-builder' ),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_single_badge_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'single_badge_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_badge_background',
array(
'label' => esc_html__( 'Background', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_badge_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'single_badge_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_responsive_control(
'single_badge_border_radius',
array(
'label' => __( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'single_badge_box_shadow',
'selector' => '{{WRAPPER}} ' . $css_scheme['badge'],
)
);
$this->add_responsive_control(
'single_badge_content_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['badge'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'single_badge_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' => 'fa fa-align-left',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'fa fa-align-center',
),
'right' => array(
'title' => esc_html__( 'Right', 'jet-woo-builder' ),
'icon' => 'fa fa-align-right',
),
),
'selectors' => array(
'{{WRAPPER}} ' => 'text-align: {{VALUE}};',
),
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,69 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Sharing
* Name: Single Sharing
* Slug: jet-single-sharing
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Sharing extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-sharing';
}
public function get_title() {
return esc_html__( 'Single Sharing', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-12';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,630 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Tabs
* Name: Single Tabs
* Slug: jet-single-tabs
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Tabs extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-tabs';
}
public function get_title() {
return esc_html__( 'Single Tabs', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-23';
}
public function get_script_depends() {
return array( 'wc-single-product' );
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-tabs/tabs/css-scheme',
array(
'control_wrapper' => '.jet-woo-builder > .jet-single-tabs__wrap ul.wc-tabs',
'content_wrapper' => '.jet-woo-builder > .jet-single-tabs__wrap .wc-tab',
'tabs_list_item' => '.jet-woo-builder > .jet-single-tabs__wrap .tabs > li',
'tabs_item' => '.jet-woo-builder > .jet-single-tabs__wrap .tabs > li > a',
'tabs_item_active' => '.jet-woo-builder > .jet-single-tabs__wrap .tabs > li.active > a',
)
);
$this->start_controls_section(
'section_single_tabs_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'single_tabs_position',
array(
'label' => esc_html__( 'Tabs Position', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'top',
'prefix_class' => 'elementor-tabs-view-',
'options' => array(
'left' => esc_html__( 'Left', 'jet-woo-builder' ),
'top' => esc_html__( 'Top', 'jet-woo-builder' ),
'right' => esc_html__( 'Right', 'jet-woo-builder' ),
),
)
);
$this->add_responsive_control(
'single_tabs_items_display',
array(
'label' => esc_html__( 'Tabs Items Display', 'jet-woo-builder' ),
'label_block'=> true,
'type' => Controls_Manager::SELECT,
'default' => 'row',
'options' => array(
'row' => esc_html__( 'Inline', 'jet-woo-builder' ),
'column' => esc_html__( 'Block', 'jet-woo-builder' ),
),
'condition' => array(
'single_tabs_position' => 'top',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'flex-direction: {{VALUE}}',
),
)
);
$this->add_responsive_control(
'single_tabs_control_wrapper_width',
array(
'label' => esc_html__( 'Tabs Control Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px',
'%',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 50,
),
'px' => array(
'min' => 100,
'max' => 500,
),
),
'condition' => array(
'single_tabs_position' => array( 'left', 'right' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'width: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'width: calc(100% - {{SIZE}}{{UNIT}})',
),
)
);
$this->add_responsive_control(
'single_tabs_controls_alignment',
array(
'label' => esc_html__( 'Tabs Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'left',
'options' => array(
'left' => array(
'title' => esc_html__( 'Start', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
),
'center' => array(
'title' => esc_html__( 'Center', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-center',
),
'stretch' => array(
'title' => esc_html__( 'Stretch', 'jet-woo-builder' ),
'icon' => 'eicon-text-align-justify',
),
'right' => array(
'title' => esc_html__( 'End', 'jet-woo-builder' ),
'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
),
),
'prefix_class' => 'elementor-tabs-controls-',
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_single_tabs_control_style',
array(
'label' => esc_html__( 'Tabs Nav', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'single_tabs_control_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['control_wrapper'],
)
);
$this->add_responsive_control(
'single_tabs_control_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'single_tabs_control_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['control_wrapper'],
)
);
$this->add_responsive_control(
'single_tabs_control_border_radius',
array(
'label' => __( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['control_wrapper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
$this->start_controls_section(
'section_single_tabs_item_style',
array(
'label' => esc_html__( 'Tabs Nav Item', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_responsive_control(
'single_tabs_item_width',
array(
'label' => esc_html__( 'Tabs Item Width', 'jet-woo-builder' ),
'type' => Controls_Manager::SLIDER,
'size_units' => array(
'px',
'%',
),
'range' => array(
'%' => array(
'min' => 10,
'max' => 100,
),
'px' => array(
'min' => 100,
'max' => 500,
),
),
'condition' => array(
'single_tabs_position' => 'top',
'single_tabs_items_display' => 'column',
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_list_item'] => 'max-width: {{SIZE}}{{UNIT}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_tabs_item_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} ' . $css_scheme['tabs_item'],
)
);
$this->add_responsive_control(
'single_tabs_item_alignment',
array(
'label' => esc_html__( 'Item Text 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['tabs_item'] => 'text-align: {{VALUE}};',
),
'classes' => 'elementor-control-align',
)
);
$this->add_responsive_control(
'single_tabs_item_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_responsive_control(
'single_tabs_item_margin',
array(
'label' => __( 'Margin', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'single_tabs_item_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['tabs_item'],
)
);
$this->add_responsive_control(
'single_tabs_item_border_radius',
array(
'label' => __( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->start_controls_tabs( 'single_tabs_item_styles' );
$this->start_controls_tab(
'single_tabs_item_normal',
array(
'label' => esc_html__( 'Normal', 'jet-woo-builder' ),
)
);
$this->add_control(
'single_tabs_item_color_normal',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_background_normal',
array(
'label' => esc_html__( 'Background', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'single_tabs_item_box_shadow_normal',
'selector' => '{{WRAPPER}} ' . $css_scheme['tabs_item'],
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'single_tabs_item_hover',
array(
'label' => esc_html__( 'Hover', 'jet-woo-builder' ),
)
);
$this->add_control(
'single_tabs_item_color_hover',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] . ':hover' => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_background_hover',
array(
'label' => esc_html__( 'Background', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] . ':hover' => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_border_color_hover',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] . ':hover' => 'border-color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_decoration_hover',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
'overline' => esc_html__( 'Overline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item'] . ':hover' => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'single_tabs_item_box_shadow_hover',
'selector' => '{{WRAPPER}} ' . $css_scheme['tabs_item'] . ':hover',
)
);
$this->end_controls_tab();
$this->start_controls_tab(
'single_tabs_item_active',
array(
'label' => esc_html__( 'Active', 'jet-woo-builder' ),
)
);
$this->add_control(
'single_tabs_item_color_active',
array(
'label' => esc_html__( 'Text Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item_active'] => 'color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_background_active',
array(
'label' => esc_html__( 'Background', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item_active'] => 'background-color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_border_color_active',
array(
'label' => esc_html__( 'Border Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item_active'] => 'border-color: {{VALUE}}',
),
)
);
$this->add_control(
'single_tabs_item_decoration_active',
array(
'label' => esc_html__( 'Text Decoration', 'jet-woo-builder' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => array(
'none' => esc_html__( 'None', 'jet-woo-builder' ),
'line-through' => esc_html__( 'Line Through', 'jet-woo-builder' ),
'underline' => esc_html__( 'Underline', 'jet-woo-builder' ),
'overline' => esc_html__( 'Overline', 'jet-woo-builder' ),
),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['tabs_item_active'] => 'text-decoration: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
array(
'name' => 'single_tabs_item_box_shadow_active',
'selector' => '{{WRAPPER}} ' . $css_scheme['tabs_item_active'],
)
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
$this->start_controls_section(
'section_single_tabs_content_style',
array(
'label' => esc_html__( 'Tabs Content', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_group_control(
Group_Control_Background::get_type(),
array(
'name' => 'single_tabs_content_background',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
)
);
$this->add_responsive_control(
'single_tabs_content_padding',
array(
'label' => __( 'Padding', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->add_group_control(
Group_Control_Border::get_type(),
array(
'name' => 'single_tabs_content_border',
'label' => esc_html__( 'Border', 'jet-woo-builder' ),
'placeholder' => '1px',
'default' => '1px',
'selector' => '{{WRAPPER}} ' . $css_scheme['content_wrapper'],
)
);
$this->add_responsive_control(
'single_tabs_content_radius',
array(
'label' => __( 'Border Radius', 'jet-woo-builder' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => array( 'px', '%' ),
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['content_wrapper'] => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
),
)
);
$this->end_controls_section();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
$this->fix_comments_template();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
public function fix_comments_template() {
if ( ! jet_woo_builder_integration()->in_elementor() && ! wp_doing_ajax() ) {
return;
}
add_filter( 'comments_template', array( $this, 'comments_template_loader' ) );
}
/**
* Load comments template
*
* @return string
*/
public function comments_template_loader( $template ) {
$check_dirs = array(
trailingslashit( get_stylesheet_directory() ) . WC()->template_path(),
trailingslashit( get_template_directory() ) . WC()->template_path(),
trailingslashit( get_stylesheet_directory() ),
trailingslashit( get_template_directory() ),
trailingslashit( WC()->plugin_path() ) . 'templates/',
);
if ( WC_TEMPLATE_DEBUG_MODE ) {
$check_dirs = array( array_pop( $check_dirs ) );
}
foreach ( $check_dirs as $dir ) {
if ( file_exists( trailingslashit( $dir ) . 'single-product-reviews.php' ) ) {
return trailingslashit( $dir ) . 'single-product-reviews.php';
}
}
}
}

View File

@@ -0,0 +1,154 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Title
* Name: Single Title
* Slug: jet-single-title
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Title extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-title';
}
public function get_title() {
return esc_html__( 'Single Title', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-13';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-title/css-scheme',
array(
'title' => '.jet-woo-builder .product_title'
)
);
$this->start_controls_section(
'section_single_title_style',
array(
'label' => esc_html__( 'General', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
'show_label' => false,
)
);
$this->add_control(
'single_title_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_responsive_control(
'single_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(
'single_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(
'single_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();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}

View File

@@ -0,0 +1,145 @@
<?php
/**
* Class: Jet_Woo_Builder_Single_Upsells
* Name: Single Upsells
* Slug: jet-single-upsells
*/
namespace Elementor;
use Elementor\Controls_Manager;
use Elementor\Group_Control_Border;
use Elementor\Group_Control_Box_Shadow;
use Elementor\Group_Control_Typography;
use Elementor\Repeater;
use Elementor\Scheme_Color;
use Elementor\Scheme_Typography;
use Elementor\Widget_Base;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
class Jet_Woo_Builder_Single_Upsells extends Jet_Woo_Builder_Base {
public function get_name() {
return 'jet-single-upsells';
}
public function get_title() {
return esc_html__( 'Single Upsells', 'jet-woo-builder' );
}
public function get_icon() {
return 'jetwoobuilder-icon-14';
}
public function get_script_depends() {
return array();
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetwoobuilder-how-to-create-and-set-a-single-product-page-template/';
}
public function get_categories() {
return array( 'jet-woo-builder' );
}
public function show_in_panel() {
return jet_woo_builder()->documents->is_document_type( 'single' );
}
protected function _register_controls() {
$css_scheme = apply_filters(
'jet-woo-builder/jet-single-upsells/css-scheme',
array(
'title' => '.jet-woo-builder > .upsells.products > h2'
)
);
$this->start_controls_section(
'section_single_upsells_style',
array(
'label' => esc_html__( 'Title', 'jet-woo-builder' ),
'tab' => Controls_Manager::TAB_STYLE,
)
);
$this->add_control(
'single_upsells_title_color',
array(
'label' => esc_html__( 'Color', 'jet-woo-builder' ),
'type' => Controls_Manager::COLOR,
'selectors' => array(
'{{WRAPPER}} ' . $css_scheme['title'] => 'color: {{VALUE}}',
),
)
);
$this->add_group_control(
Group_Control_Typography::get_type(),
array(
'name' => 'single_upsells_title_typography',
'selector' => '{{WRAPPER}} ' . $css_scheme['title'],
)
);
$this->add_responsive_control(
'single_upsells_title_margin',
array(
'label' => __( '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(
'single_upsells_title_alignment',
array(
'label' => esc_html__( 'Alignment', 'jet-woo-builder' ),
'type' => Controls_Manager::CHOOSE,
'default' => 'center',
'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();
}
protected function render() {
$this->__context = 'render';
if ( true === $this->__set_editor_product() ) {
$this->__open_wrap();
include $this->__get_global_template( 'index' );
$this->__close_wrap();
$this->__reset_editor_product();
}
}
}