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