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