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,93 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Booked_Appointments extends Jet_Elements_Base {
public function get_name() {
return 'jet-booked-appointments';
}
public function get_title() {
return esc_html__( 'Booked Appointments', 'jet-elements' );
}
public function get_icon() {
return 'eicon-date';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/article-category/jet-elements/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'booked-appointments';
}
public function __atts() {
return array(
'historic' => array(
'label' => esc_html__( 'Is Past Appointments?', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'on' => esc_html__( 'Yes', 'jet-elements' ),
'off' => esc_html__( 'No', 'jet-elements' ),
),
),
'remove_wrapper' => array(
'label' => esc_html__( 'Remove HTML wrappers', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'on' => esc_html__( 'Yes', 'jet-elements' ),
'off' => esc_html__( 'No', 'jet-elements' ),
),
),
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,109 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Booked_Calendar extends Jet_Elements_Base {
public function get_name() {
return 'jet-booked-calendar';
}
public function get_title() {
return esc_html__( 'Booked Calendar', 'jet-elements' );
}
public function get_icon() {
return 'eicon-date';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/article-category/jet-elements/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'booked-calendar';
}
public function __atts() {
return array(
'calendar' => array(
'label' => esc_html__( 'Calendar ID', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => '',
),
'year' => array(
'label' => esc_html__( 'Year', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => '',
),
'month' => array(
'label' => esc_html__( 'Month', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
'default' => '',
),
'switcher' => array(
'label' => esc_html__( 'Show calendar switcher?', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'on' => esc_html__( 'Yes', 'jet-elements' ),
'off' => esc_html__( 'No', 'jet-elements' ),
),
),
'size' => array(
'label' => esc_html__( 'Calendar size', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'options' => array(
'large' => esc_html__( 'Large', 'jet-elements' ),
'small' => esc_html__( 'Small', 'jet-elements' ),
),
),
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,304 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Mp_Timetable extends Jet_Elements_Base {
public function get_name() {
return 'mp-timetable';
}
public function get_title() {
return esc_html__( 'Timetable by MotoPress', 'jet-elements' );
}
public function get_icon() {
return 'eicon-table';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/article-category/jet-elements/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'mp-timetable';
}
public function get_script_depends() {
if ( ! isset( $_GET['elementor-preview'] ) ) {
return array();
}
$core = \mp_timetable\plugin_core\classes\Core::get_instance();
wp_register_script(
'mptt-event-object',
\Mp_Time_Table::get_plugin_url( 'media/js/events/event' . $core->get_prefix() . '.js' ),
array( 'jquery' ),
$core->get_version()
);
wp_register_script(
'mptt-functions',
\Mp_Time_Table::get_plugin_url( 'media/js/mptt-functions' . $core->get_prefix() . '.js' ),
array( 'jquery', 'underscore' ),
$core->get_version()
);
wp_localize_script(
'mptt-event-object',
'MPTT',
array(
'table_class' => apply_filters( 'mptt_shortcode_static_table_class', 'mptt-shortcode-table' ),
)
);
return array( 'mptt-functions', 'mptt-event-object' );
}
/**
* @param array $data_array
* @param string $type
*
* @return array
*/
public function __create_list( $data_array = array(), $type = 'post' ) {
$list_array = array();
switch ( $type ) {
case "post":
foreach ( $data_array as $item ) {
$list_array[ $item->ID ] = $item->post_title;
}
break;
case "term":
foreach ( $data_array as $item ) {
$list_array[ $item->term_id ] = $item->name;
}
break;
default:
break;
}
return $list_array;
}
public function __atts() {
$columns = $this->__create_list( \mp_timetable\classes\models\Column::get_instance()->get_all_column() );
$events = $this->__create_list( \mp_timetable\classes\models\Events::get_instance()->get_all_events() );
$categories = get_terms( 'mp-event_category', 'orderby=count&hide_empty=0' );
$categories = $this->__create_list( $categories, 'term' );
return array(
'col' => array(
'type' => Controls_Manager::SELECT2,
'label' => __( 'Column', 'jet-elements' ),
'multiple' => true,
'options' => $columns,
),
'events' => array(
'type' => Controls_Manager::SELECT2,
'label' => __( 'Events', 'jet-elements' ),
'multiple' => true,
'options' => $events,
),
'event_categ' => array(
'type' => Controls_Manager::SELECT2,
'label' => __( 'Event categories', 'jet-elements' ),
'multiple' => true,
'options' => $categories,
),
'increment' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Hour measure', 'jet-elements' ),
'default' => '1',
'options' => array(
'1' => __( 'Hour (1h)', 'jet-elements' ),
'0.5' => __( 'Half hour (30min)', 'jet-elements' ),
'0.25' => __( 'Quarter hour (15min)', 'jet-elements' ),
),
),
'view' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Filter style', 'jet-elements' ),
'default' => 'dropdown_list',
'options' => array(
'dropdown_list' => __( 'Dropdown list', 'jet-elements' ),
'tabs' => __( 'Tabs', 'jet-elements' ),
),
),
'label' => array(
'type' => Controls_Manager::TEXT,
'label' => __( 'Filter label', 'jet-elements' ),
'default' => __( 'All Events', 'jet-elements' ),
),
'hide_label' => array(
'type' => Controls_Manager::SELECT,
'label' => __( "Hide 'All Events' view", 'jet-elements' ),
'default' => '0',
'options' => array(
'0' => __( 'No', 'jet-elements' ),
'1' => __( 'Yes', 'jet-elements' ),
),
),
'hide_hrs' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Hide first (hours) column', 'jet-elements' ),
'default' => '0',
'options' => array(
'0' => __( 'No', 'jet-elements' ),
'1' => __( 'Yes', 'jet-elements' ),
),
),
'hide_empty_rows' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Hide empty rows', 'jet-elements' ),
'default' => '1',
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
'default' => 1,
),
'title' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Title', 'jet-elements' ),
'default' => 1,
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
),
'time' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Time', 'jet-elements' ),
'default' => 1,
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
),
'sub-title' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Subtitle', 'jet-elements' ),
'default' => 1,
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
),
'description' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Description', 'jet-elements' ),
'default' => 0,
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
),
'user' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'User', 'jet-elements' ),
'default' => 0,
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
),
'disable_event_url' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Disable event URL', 'jet-elements' ),
'default' => '0',
'options' => array(
'0' => __( 'No', 'jet-elements' ),
'1' => __( 'Yes', 'jet-elements' ),
),
),
'text_align' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Text align', 'jet-elements' ),
'default' => 'center',
'options' => array(
'center' => __( 'center', 'jet-elements' ),
'left' => __( 'left', 'jet-elements' ),
'right' => __( 'right', 'jet-elements' ),
),
),
'css_id' => array(
'type' => Controls_Manager::TEXT,
'label' => __( 'Id', 'jet-elements' )
),
'row_height' => array(
'type' => Controls_Manager::TEXT,
'label' => __( 'Row height (in px)', 'jet-elements' ),
'default' => 45
),
'font_size' => array(
'type' => Controls_Manager::TEXT,
'label' => __( 'Base Font Size', 'jet-elements' ),
'default' => ''
),
'responsive' => array(
'type' => Controls_Manager::SELECT,
'label' => __( 'Responsive', 'jet-elements' ),
'default' => '1',
'options' => array(
'1' => __( 'Yes', 'jet-elements' ),
'0' => __( 'No', 'jet-elements' ),
),
'default' => 1,
)
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
if ( 'css_id' === $attr ) {
$attr = 'id';
}
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,188 @@
<?php
namespace Elementor;
use Elementor\Utils;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Smartslider3 extends Jet_Elements_Base {
public function get_name() {
return 'smartslider3';
}
public function get_title() {
return esc_html__( 'Smart Slider', 'jet-elements' );
}
public function get_icon() {
return 'eicon-post-slider';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/article-category/jet-elements/';
}
public function get_categories() {
return array( 'cherry' );
}
public function is_reload_preview_required() {
return true;
}
protected function _register_controls() {
$this->start_controls_section(
'section_slider',
array(
'label' => esc_html__( 'Slider', 'jet-elements' ),
)
);
$this->add_control(
'slider',
array(
'label' => esc_html__( 'Select slider', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => $this->get_sliders()
)
);
$this->add_control(
'set_key',
array(
'type' => Controls_Manager::RAW_HTML,
'raw' => __( '<strong>Note:</strong> In Editor mode slider will be appended only as preview image to speed up the editing. On frontend slider will be shown as usual slider.', 'jet-elements' ),
)
);
$this->end_controls_section();
}
protected function get_sliders() {
global $wpdb;
$tablename = $wpdb->prefix . 'nextend2_smartslider3_sliders';
$results = $wpdb->get_results( "SELECT * FROM $tablename" );
if ( empty( $results ) ) {
return array();
}
$slides = wp_list_pluck( $results, 'title', 'id' );
array_walk( $slides, array( $this, 'map_slides' ) );
return $slides;
}
public function map_slides( &$item, $key ) {
$item = sprintf( '%s (id:%s)', $item, $key );
}
/**
* Returns slider module wrapper format
*/
protected function get_slider_format() {
return apply_filters(
'cherry-elemetor/addons/smartslider3/format',
'<div class="elementor-smartslider">%s</div>'
);
}
protected function render() {
$slider = $this->get_settings( 'slider' );
if ( ! jet_elements_integration()->in_elementor() ) {
if ( ! $slider ) {
return;
}
printf(
$this->get_slider_format(),
do_shortcode( '[smartslider3 slider=' . $slider . ']' )
);
return;
}
global $wpdb;
$sliderstable = $wpdb->prefix . 'nextend2_smartslider3_sliders';
$slidestable = $wpdb->prefix . 'nextend2_smartslider3_slides';
$placeholder = esc_html__( 'Please, select slider to show', 'jet-elements' );
$format = '<div class="elementor-smartslider">%s</div>';
if ( ! $slider ) {
printf( $format, $placeholder );
return;
}
$row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $sliderstable WHERE id=%d", $slider ) );
if ( null === $row ) {
printf( $format, $placeholder );
return;
}
$params = json_decode( $row->params, ARRAY_A );
if ( 'fullwidth' === $params['responsive-mode'] ) {
$height = isset( $params['responsiveSliderHeightMax'] )
? $params['responsiveSliderHeightMax'] . 'px'
: ( isset( $params['height'] ) ? $params['height'] . 'px' : 'auto' );
} else {
$height = isset( $params['height'] ) ? $params['height'] . 'px' : 'auto';
}
$slide = $wpdb->get_row(
$wpdb->prepare( "SELECT * FROM $slidestable WHERE slider = %d AND ordering = 0", $slider )
);
if ( null === $slide ) {
printf( $format, $placeholder );
return;
}
$slide_params = json_decode( $slide->params, ARRAY_A );
$image = sprintf(
'<div style="overflow:hidden;height:%1$s;display:flex;">
<img style="width: 100%;object-fit: cover;" src="%2$s" alt="">
</div>',
$height,
$this->get_placeholder_image( $slide_params )
);
printf( $format, $image );
}
public function get_placeholder_image( $slide_params ) {
$uploads = wp_upload_dir();
$base = $uploads['baseurl'];
if ( ! empty( $slide_params['backgroundImage'] ) ) {
$img = str_replace( '$upload$', $base, $slide_params['backgroundImage'] );
} else {
$img = Utils::get_placeholder_image_src();
}
return $img;
}
public function render_plain_content() {
// In plain mode, render without shortcode
$slider = $this->get_settings( 'slider' );
printf( '[smartslider3 slider="%s"]', $slider );
}
protected function _content_template() {}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Best_Selling_Products extends Jet_Elements_Base {
public function get_name() {
return 'woo-best-selling-products';
}
public function get_title() {
return esc_html__( 'WooCommerce Best Sellers', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-best-sellers-products';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-best-sellers-widget-how-to-add-best-sellers-products-to-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'best_selling_products';
}
public function __atts() {
return array(
'per_page' => array(
'label' => esc_html__( 'Products per page', 'jet-elements' ),
'type' => Controls_Manager::NUMBER,
'default' => 12,
),
'columns' => array(
'label' => esc_html__( 'Columns', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '4',
'options' => array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
),
),
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,108 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Featured_Products extends Jet_Elements_Base {
public function get_name() {
return 'woo-featured-products';
}
public function get_title() {
return esc_html__( 'WooCommerce Featured Products', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-featured-products';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-featured-products-widget-how-to-display-featured-products-on-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'featured_products';
}
public function __atts() {
return array(
'per_page' => array(
'label' => esc_html__( 'Products per page', 'jet-elements' ),
'type' => Controls_Manager::NUMBER,
'default' => 12,
),
'columns' => array(
'label' => esc_html__( 'Columns', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '4',
'options' => array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
),
),
'orderby' => array(
'label' => esc_html__( 'Order By', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => jet_elements_tools()->orderby_arr(),
),
'order' => array(
'label' => esc_html__( 'Order', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'desc',
'options' => jet_elements_tools()->order_arr(),
)
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,90 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Product extends Jet_Elements_Base {
public function get_name() {
return 'woo-product';
}
public function get_title() {
return esc_html__( 'WooCommerce Product', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-product';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-product-widget-how-to-add-custom-products-to-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'product';
}
public function __atts() {
return array(
'product_id' => array(
'label' => esc_html__( 'Product ID', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
),
'sku' => array(
'label' => esc_html__( 'Product SKU', 'jet-elements' ),
'type' => Controls_Manager::TEXT,
),
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
if ( 'product_id' === $attr ) {
$attr = 'id';
}
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,108 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Recent_Products extends Jet_Elements_Base {
public function get_name() {
return 'woo-recent-products';
}
public function get_title() {
return esc_html__( 'WooCommerce Recent Products', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-recent-products';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-recent-products-widget-how-to-display-recent-products-on-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'recent_products';
}
public function __atts() {
return array(
'per_page' => array(
'label' => esc_html__( 'Products per page', 'jet-elements' ),
'type' => Controls_Manager::NUMBER,
'default' => 12,
),
'columns' => array(
'label' => esc_html__( 'Columns', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '4',
'options' => array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
),
),
'orderby' => array(
'label' => esc_html__( 'Order By', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => jet_elements_tools()->orderby_arr(),
),
'order' => array(
'label' => esc_html__( 'Order', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'desc',
'options' => jet_elements_tools()->order_arr(),
)
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,116 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Sale_Products extends Jet_Elements_Base {
public function get_name() {
return 'woo-sale-products';
}
public function get_title() {
return esc_html__( 'WooCommerce Sale Products', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-sale-products';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-sale-products-widget-how-to-add-products-on-sale-to-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'sale_products';
}
public function __atts() {
return array(
'per_page' => array(
'label' => esc_html__( 'Products per page', 'jet-elements' ),
'type' => Controls_Manager::NUMBER,
'default' => 12,
),
'columns' => array(
'label' => esc_html__( 'Columns', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '4',
'options' => array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
),
),
'orderby' => array(
'label' => esc_html__( 'Order By', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => jet_elements_tools()->orderby_arr(),
),
'order' => array(
'label' => esc_html__( 'Order', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => 'desc',
'options' => jet_elements_tools()->order_arr(),
),
'paginate' => array(
'type' => 'switcher',
'label' => esc_html__( 'Show Sale Products Pagination', 'jet-elements' ),
'label_on' => esc_html__( 'Yes', 'jet-woo-builder' ),
'label_off' => esc_html__( 'No', 'jet-woo-builder' ),
'return_value' => 'yes',
'default' => '',
)
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Jet_Elements_Woo_Top_Rated_Products extends Jet_Elements_Base {
public function get_name() {
return 'woo-top-rated-products';
}
public function get_title() {
return esc_html__( 'WooCommerce Top Rated Products', 'jet-elements' );
}
public function get_icon() {
return 'jet-elements-icon-woo-top-rated-products';
}
public function get_jet_help_url() {
return 'https://crocoblock.com/knowledge-base/articles/jetelements-woocommerce-top-rated-products-widget-how-to-showcase-the-best-products-on-your-website/';
}
public function get_categories() {
return array( 'cherry' );
}
public function __tag() {
return 'top_rated_products';
}
public function __atts() {
return array(
'per_page' => array(
'label' => esc_html__( 'Products per page', 'jet-elements' ),
'type' => Controls_Manager::NUMBER,
'default' => 12,
),
'columns' => array(
'label' => esc_html__( 'Columns', 'jet-elements' ),
'type' => Controls_Manager::SELECT,
'default' => '4',
'options' => array(
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
),
),
);
}
protected function _register_controls() {
$this->start_controls_section(
'section_settings',
array(
'label' => esc_html__( 'Settings', 'jet-elements' ),
)
);
foreach ( $this->__atts() as $control => $data ) {
$this->add_control( $control, $data );
}
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings();
$this->__context = 'render';
$this->__open_wrap();
$attributes = '';
foreach ( $this->__atts() as $attr => $data ) {
$attr_val = $settings[ $attr ];
$attr_val = ! is_array( $attr_val ) ? $attr_val : implode( ',', $attr_val );
$attributes .= sprintf( ' %1$s="%2$s"', $attr, $attr_val );
}
$shortcode = sprintf( '[%s %s]', $this->__tag(), $attributes );
echo do_shortcode( $shortcode );
$this->__close_wrap();
}
}