File: //proc/self/cwd/wp-content/plugins/woolentor-addons/includes/addons/universal_product.php
<?php
namespace Elementor;
// Elementor Classes
use \Elementor\Core\Schemes\Color as Scheme_Color;
use \Elementor\Core\Schemes\Typography as Scheme_Typography;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Woolentor_Universal_Product_Layout_Widget extends Widget_Base {
public function get_name() {
return 'woolentor-universal-product';
}
public function get_title() {
return __( 'WL: Universal Product Layout', 'woolentor' );
}
public function get_icon() {
return 'eicon-cart-light';
}
public function get_categories() {
return [ 'woolentor-addons' ];
}
public function get_style_depends(){
return [
'htflexboxgrid',
'font-awesome',
'simple-line-icons',
'elementor-icons-shared-0-css','elementor-icons-fa-brands','elementor-icons-fa-regular','elementor-icons-fa-solid',
'slick',
'woolentor-widgets',
];
}
public function get_script_depends() {
return [
'slick',
'countdown-min',
'woolentor-widgets-scripts',
];
}
public function get_keywords(){
return ['slider','product','universal','universal product','universal layout'];
}
protected function _register_controls() {
// Product Content
$this->start_controls_section(
'woolentor-products-layout-setting',
[
'label' => esc_html__( 'Layout Settings', 'woolentor' ),
]
);
$this->add_control(
'product_layout_style',
[
'label' => __( 'Layout', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'slider' => __( 'Slider', 'woolentor' ),
'tab' => __( 'Tab', 'woolentor' ),
'default' => __( 'Default', 'woolentor' ),
]
]
);
$this->add_control(
'woolentor_product_grid_column',
[
'label' => esc_html__( 'Columns', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => '3',
'options' => [
'1' => esc_html__( '1', 'woolentor' ),
'2' => esc_html__( '2', 'woolentor' ),
'3' => esc_html__( '3', 'woolentor' ),
'4' => esc_html__( '4', 'woolentor' ),
'5' => esc_html__( '5', 'woolentor' ),
'6' => esc_html__( '6', 'woolentor' ),
],
'condition' => [
'product_layout_style!' => 'slider',
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'woolentor-products',
[
'label' => esc_html__( 'Query Settings', 'woolentor' ),
]
);
$this->add_control(
'woolentor_product_grid_product_filter',
[
'label' => esc_html__( 'Filter By', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => 'recent',
'options' => [
'recent' => esc_html__( 'Recent Products', 'woolentor' ),
'featured' => esc_html__( 'Featured Products', 'woolentor' ),
'best_selling' => esc_html__( 'Best Selling Products', 'woolentor' ),
'sale' => esc_html__( 'Sale Products', 'woolentor' ),
'top_rated' => esc_html__( 'Top Rated Products', 'woolentor' ),
'mixed_order' => esc_html__( 'Random Products', 'woolentor' ),
'show_byid' => esc_html__( 'Show By ID', 'woolentor' ),
'show_byid_manually' => esc_html__( 'Add ID Manually', 'woolentor' ),
],
]
);
$this->add_control(
'woolentor_product_id',
[
'label' => __( 'Select Product', 'woolentor' ),
'type' => Controls_Manager::SELECT2,
'label_block' => true,
'multiple' => true,
'options' => woolentor_post_name( 'product' ),
'condition' => [
'woolentor_product_grid_product_filter' => 'show_byid',
]
]
);
$this->add_control(
'woolentor_product_ids_manually',
[
'label' => __( 'Product IDs', 'woolentor' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'condition' => [
'woolentor_product_grid_product_filter' => 'show_byid_manually',
]
]
);
$this->add_control(
'woolentor_product_grid_products_count',
[
'label' => __( 'Product Limit', 'woolentor' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'step' => 1,
]
);
$this->add_control(
'woolentor_product_grid_categories',
[
'label' => esc_html__( 'Product Categories', 'woolentor' ),
'type' => Controls_Manager::SELECT2,
'label_block' => true,
'multiple' => true,
'options' => woolentor_taxonomy_list(),
'condition' => [
'woolentor_product_grid_product_filter!' => 'show_byid',
]
]
);
$this->add_control(
'woolentor_custom_order',
[
'label' => esc_html__( 'Custom Order', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'orderby',
[
'label' => esc_html__( 'Order by', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => [
'none' => esc_html__('None','woolentor'),
'ID' => esc_html__('ID','woolentor'),
'date' => esc_html__('Date','woolentor'),
'name' => esc_html__('Name','woolentor'),
'title' => esc_html__('Title','woolentor'),
'comment_count' => esc_html__('Comment count','woolentor'),
'rand' => esc_html__('Random','woolentor'),
],
'condition' => [
'woolentor_custom_order' => 'yes',
]
]
);
$this->add_control(
'order',
[
'label' => esc_html__( 'Order', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => [
'DESC' => esc_html__('Descending','woolentor'),
'ASC' => esc_html__('Ascending','woolentor'),
],
'condition' => [
'woolentor_custom_order' => 'yes',
]
]
);
$this->end_controls_section();
// Product Content
$this->start_controls_section(
'woolentor-products-content-setting',
[
'label' => esc_html__( 'Content Settings', 'woolentor' ),
]
);
$this->add_control(
'product_content_style',
[
'label' => __( 'Style', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => __( 'Style One', 'woolentor' ),
'2' => __( 'Style Two', 'woolentor' ),
'3' => __( 'Style Three', 'woolentor' ),
'4' => __( 'Style Four', 'woolentor' ),
]
]
);
$this->add_control(
'hide_product_title',
[
'label' => __( 'Hide Title', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .ht-product-inner .ht-product-title' => 'display: none !important;',
],
]
);
$this->add_control(
'hide_product_price',
[
'label' => __( 'Hide Price', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .ht-product-inner .ht-product-price' => 'display: none !important;',
],
]
);
$this->add_control(
'hide_product_category',
[
'label' => __( 'Hide Category', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .ht-product-inner .ht-product-categories' => 'display: none !important;',
],
]
);
$this->add_control(
'hide_category_before_border',
[
'label' => __( 'Hide category before border', 'woolentor-pro' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .ht-product-inner .ht-product-categories::before' => 'display: none !important;',
'{{WRAPPER}} .ht-product-inner .ht-product-categories' => 'padding-left: 0 !important;',
],
]
);
$this->add_control(
'hide_product_ratting',
[
'label' => __( 'Hide Rating', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'selectors' => [
'{{WRAPPER}} .ht-product-inner .ht-product-ratting-wrap' => 'display: none !important;',
],
]
);
$this->end_controls_section();
// Product Action Button
$this->start_controls_section(
'woolentor-products-action-button',
[
'label' => esc_html__( 'Action Button Settings', 'woolentor' ),
]
);
$this->add_control(
'show_action_button',
[
'label' => __( 'Action Button', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'woolentor' ),
'label_off' => __( 'Hide', 'woolentor' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'action_button_style',
[
'label' => __( 'Style', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => __( 'Style One', 'woolentor' ),
'2' => __( 'Style Two', 'woolentor' ),
'3' => __( 'Style Three', 'woolentor' ),
],
'condition'=>[
'show_action_button'=>'yes',
]
]
);
$this->add_control(
'action_button_show_on',
[
'label' => __( 'Show on', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => 'normal',
'options' => [
'hover' => __( 'Hover', 'woolentor' ),
'normal' => __( 'Normal', 'woolentor' ),
],
'condition'=>[
'show_action_button'=>'yes',
]
]
);
$this->add_control(
'action_button_position',
[
'label' => __( 'Position', 'woolentor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'woolentor' ),
'icon' => 'eicon-h-align-left',
],
'right' => [
'title' => __( 'Right', 'woolentor' ),
'icon' => 'eicon-h-align-right',
],
'middle' => [
'title' => __( 'Middle', 'woolentor' ),
'icon' => 'eicon-v-align-middle',
],
'bottom' => [
'title' => __( 'Bottom', 'woolentor' ),
'icon' => 'eicon-v-align-bottom',
],
'contentbottom' => [
'title' => __( 'Content Bottom', 'woolentor' ),
'icon' => 'eicon-v-align-bottom',
],
],
'default' => is_rtl() ? 'left' : 'right',
'toggle' => false,
'condition'=>[
'show_action_button'=>'yes',
]
]
);
$this->add_control(
'addtocart_button_txt',
[
'label' => __( 'Show Add to Cart Button Text', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
]
);
$this->end_controls_section();
// Product Image Setting
$this->start_controls_section(
'woolentor-products-thumbnails-setting',
[
'label' => esc_html__( 'Image Settings', 'woolentor' ),
]
);
$this->add_control(
'thumbnails_style',
[
'label' => __( 'Thumbnails Style', 'woolentor' ),
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => __( 'Single Image', 'woolentor' ),
'2' => __( 'Image Slider', 'woolentor' ),
'3' => __( 'Gallery Tab', 'woolentor' ),
]
]
);
$this->add_control(
'image_navigation_bg_color',
[
'label' => __( 'Arrows Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#444444',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-image .ht-product-image-slider .slick-arrow' => 'color: {{VALUE}} !important;',
],
'condition'=>[
'thumbnails_style'=>'2',
]
]
);
$this->add_control(
'image_dots_normal_bg_color',
[
'label' => __( 'Dots Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#cccccc',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-image .ht-product-image-slider .slick-dots li button' => 'background-color: {{VALUE}} !important;',
],
'condition'=>[
'thumbnails_style'=>'2',
]
]
);
$this->add_control(
'image_dots_hover_bg_color',
[
'label' => __( 'Dots Active Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'condition'=>[
'thumbnails_style'=>'2',
],
'default' =>'#666666',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-image .ht-product-image-slider .slick-dots li.slick-active button' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_control(
'image_tab_menu_border_color',
[
'label' => __( 'Border Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#737373',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-image .ht-product-cus-tab-links li a' => 'border-color: {{VALUE}};',
],
'condition'=>[
'thumbnails_style'=>'3',
]
]
);
$this->add_control(
'image_tab_menu_active_border_color',
[
'label' => __( 'Active Border Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ECC87B',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-image .ht-product-cus-tab-links li a.htactive' => 'border-color: {{VALUE}} !important;',
],
'condition'=>[
'thumbnails_style'=>'3',
]
]
);
$this->end_controls_section();
// Product countdown
$this->start_controls_section(
'woolentor-products-countdown-setting',
[
'label' => esc_html__( 'Countdown Settings', 'woolentor' ),
]
);
$this->add_control(
'show_countdown',
[
'label' => __( 'Show Countdown Timer', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'woolentor' ),
'label_off' => __( 'Hide', 'woolentor' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'show_countdown_gutter',
[
'label' => __( 'Gutter', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'woolentor' ),
'label_off' => __( 'No', 'woolentor' ),
'return_value' => 'yes',
'default' => 'yes',
'condition' =>[
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'product_countdown_position',
[
'label' => __( 'Position', 'woolentor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'woolentor' ),
'icon' => 'eicon-h-align-left',
],
'right' => [
'title' => __( 'Right', 'woolentor' ),
'icon' => 'eicon-h-align-right',
],
'middle' => [
'title' => __( 'Middle', 'woolentor' ),
'icon' => 'eicon-v-align-middle',
],
'bottom' => [
'title' => __( 'Bottom', 'woolentor' ),
'icon' => 'eicon-v-align-bottom',
],
'contentbottom' => [
'title' => __( 'Content Bottom', 'woolentor' ),
'icon' => 'eicon-v-align-bottom',
],
],
'default' => 'bottom',
'toggle' => false,
'label_block' => true,
'condition' =>[
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'custom_labels',
[
'label' => __( 'Custom Label', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'condition' => [
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'customlabel_days',
[
'label' => __( 'Days', 'woolentor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Days', 'woolentor' ),
'condition' => [
'custom_labels!' => '',
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'customlabel_hours',
[
'label' => __( 'Hours', 'woolentor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Hours', 'woolentor' ),
'condition' => [
'custom_labels!' => '',
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'customlabel_minutes',
[
'label' => __( 'Minutes', 'woolentor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Minutes', 'woolentor' ),
'condition' => [
'custom_labels!' => '',
'show_countdown' => 'yes',
]
]
);
$this->add_control(
'customlabel_seconds',
[
'label' => __( 'Seconds', 'woolentor' ),
'type' => Controls_Manager::TEXT,
'placeholder' => __( 'Seconds', 'woolentor' ),
'condition' => [
'custom_labels!' => '',
'show_countdown' => 'yes',
]
]
);
$this->end_controls_section();
// Product slider setting
$this->start_controls_section(
'woolentor-products-slider',
[
'label' => esc_html__( 'Slider Option', 'woolentor' ),
'condition' => [
'product_layout_style' => 'slider',
]
]
);
$this->add_control(
'slitems',
[
'label' => esc_html__( 'Slider Items', 'woolentor' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 10,
'step' => 1,
'default' => 3
]
);
$this->add_control(
'slarrows',
[
'label' => esc_html__( 'Slider Arrow', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'sldots',
[
'label' => esc_html__( 'Slider dots', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'default' => 'no'
]
);
$this->add_control(
'slpause_on_hover',
[
'type' => Controls_Manager::SWITCHER,
'label_off' => __('No', 'woolentor'),
'label_on' => __('Yes', 'woolentor'),
'return_value' => 'yes',
'default' => 'yes',
'label' => __('Pause on Hover?', 'woolentor'),
]
);
$this->add_control(
'slautolay',
[
'label' => esc_html__( 'Slider auto play', 'woolentor' ),
'type' => Controls_Manager::SWITCHER,
'return_value' => 'yes',
'separator' => 'before',
'default' => 'no'
]
);
$this->add_control(
'slautoplay_speed',
[
'label' => __('Autoplay speed', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'default' => 3000,
'condition' => [
'slautolay' => 'yes',
]
]
);
$this->add_control(
'slanimation_speed',
[
'label' => __('Autoplay animation speed', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'default' => 300,
'condition' => [
'slautolay' => 'yes',
]
]
);
$this->add_control(
'slscroll_columns',
[
'label' => __('Slider item to scroll', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 10,
'step' => 1,
'default' => 3,
]
);
$this->add_control(
'heading_tablet',
[
'label' => __( 'Tablet', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'after',
]
);
$this->add_control(
'sltablet_display_columns',
[
'label' => __('Slider Items', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 8,
'step' => 1,
'default' => 2,
]
);
$this->add_control(
'sltablet_scroll_columns',
[
'label' => __('Slider item to scroll', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 8,
'step' => 1,
'default' => 2,
]
);
$this->add_control(
'sltablet_width',
[
'label' => __('Tablet Resolution', 'woolentor'),
'description' => __('The resolution to tablet.', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'default' => 750,
]
);
$this->add_control(
'heading_mobile',
[
'label' => __( 'Mobile Phone', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'after',
]
);
$this->add_control(
'slmobile_display_columns',
[
'label' => __('Slider Items', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 4,
'step' => 1,
'default' => 1,
]
);
$this->add_control(
'slmobile_scroll_columns',
[
'label' => __('Slider item to scroll', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 4,
'step' => 1,
'default' => 1,
]
);
$this->add_control(
'slmobile_width',
[
'label' => __('Mobile Resolution', 'woolentor'),
'description' => __('The resolution to mobile.', 'woolentor'),
'type' => Controls_Manager::NUMBER,
'default' => 480,
]
);
$this->end_controls_section(); // Slider Option end
// Style Default tab section
$this->start_controls_section(
'universal_product_style_section',
[
'label' => __( 'Style', 'woolentor' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'product_inner_padding',
[
'label' => __( 'Padding', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .woocommerce div.product.mb-30' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'product_inner_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .woocommerce div.product.mb-30' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'product_inner_border_color',
[
'label' => __( 'Border Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => '#f1f1f1',
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner' => 'border-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'product_inner_box_shadow',
'label' => __( 'Hover Box Shadow', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner:hover',
]
);
$this->add_control(
'product_content_area_heading',
[
'label' => __( 'Content area', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'product_content_area_padding',
[
'label' => __( 'Padding', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'product_content_area_bg_color',
[
'label' => __( 'Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'content_area_bg','woolentor_style_tabs', '#ffffff' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content' => 'background-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'product_content_area_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content',
]
);
$this->add_control(
'product_badge_heading',
[
'label' => __( 'Product Badge', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'product_badge_color',
[
'label' => __( 'Badge Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'badge_color','woolentor_style_tabs', '#444444' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-label' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'product_badge_bg_color',
[
'label' => __( 'Badge Background Color', 'woolentor-pro' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-label' => 'background-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'product_badge_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-label',
]
);
$this->add_responsive_control(
'product_badge_padding',
[
'label' => __( 'Padding', 'woolentor-pro' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-image-wrap .ht-product-label' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
// Product Category
$this->add_control(
'product_category_heading',
[
'label' => __( 'Product Category', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'product_category_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-categories a',
]
);
$this->add_control(
'product_category_color',
[
'label' => __( 'Category Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'category_color','woolentor_style_tabs', '#444444' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-categories a' => 'color: {{VALUE}};',
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-categories::before' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'product_category_hover_color',
[
'label' => __( 'Category Hover Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'category_hover_color','woolentor_style_tabs', '#dc9a0e' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-categories a:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'product_category_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-categories' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
// Product Title
$this->add_control(
'product_title_heading',
[
'label' => __( 'Product Title', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'product_title_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-title a',
]
);
$this->add_control(
'product_title_color',
[
'label' => __( 'Title Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'title_color','woolentor_style_tabs', '#444444' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-title a' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'product_title_hover_color',
[
'label' => __( 'Title Hover Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'title_hover_color','woolentor_style_tabs', '#dc9a0e' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-title a:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'product_title_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
// Product Price
$this->add_control(
'product_price_heading',
[
'label' => __( 'Product Price', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'product_sale_price_color',
[
'label' => __( 'Sale Price Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'sale_price_color','woolentor_style_tabs', '#444444' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price span' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'product_sale_price_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price span',
]
);
$this->add_control(
'product_regular_price_color',
[
'label' => __( 'Regular Price Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'separator' => 'before',
'default' => woolentor_get_option( 'regular_price_color','woolentor_style_tabs', '#444444' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price span del span,{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price span del' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'product_regular_price_typography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price span del span',
]
);
$this->add_responsive_control(
'product_price_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
// Product Rating
$this->add_control(
'product_rating_heading',
[
'label' => __( 'Product Rating', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'product_rating_color',
[
'label' => __( 'Empty Rating Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'empty_rating_color','woolentor_style_tabs', '#aaaaaa' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-ratting-wrap .ht-product-ratting .ht-product-user-ratting i.empty' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'product_rating_give_color',
[
'label' => __( 'Rating Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'rating_color','woolentor_style_tabs', '#dc9a0e' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-ratting-wrap .ht-product-ratting .ht-product-user-ratting i' => 'color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'product_rating_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-content .ht-product-content-inner .ht-product-ratting-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section(); // Style Default End
// Style Action Button tab section
$this->start_controls_section(
'universal_product_action_button_style_section',
[
'label' => __( 'Action Button Style', 'woolentor' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'product_action_button_background_color',
'label' => __( 'Background', 'woolentor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'product_action_button_box_shadow',
'label' => __( 'Box Shadow', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul',
]
);
$this->add_control(
'product_tooltip_heading',
[
'label' => __( 'Tooltip', 'woolentor' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'product_tooltip_color',
[
'label' => __( 'Tooltip Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'tooltip_color','woolentor_style_tabs', '#ffffff' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a .ht-product-action-tooltip,{{WRAPPER}} span.woolentor-tip' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'product_action_button_tooltip_background_color',
'label' => __( 'Background', 'woolentor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a .ht-product-action-tooltip,{{WRAPPER}} span.woolentor-tip',
]
);
$this->start_controls_tabs('product_action_button_style_tabs');
// Normal
$this->start_controls_tab(
'product_action_button_style_normal_tab',
[
'label' => __( 'Normal', 'woolentor' ),
]
);
$this->add_control(
'product_action_button_normal_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'btn_color','woolentor_style_tabs', '#000000' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a' => 'color: {{VALUE}};',
],
]
);
$this->add_responsive_control(
'product_action_button_font_size',
[
'label' => __( 'Font Size', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 20,
],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a i' => 'font-size: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .woolentor-compare.compare::before,{{WRAPPER}} .ht-product-action ul li.woolentor-cart a::before' => 'font-size: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'product_action_button_line_height',
[
'label' => __( 'Line Height', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 30,
],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a i' => 'line-height: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .woolentor-compare.compare::before,{{WRAPPER}} .ht-product-action ul li.woolentor-cart a::before' => 'line-height: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'product_action_button_normal_background_color',
'label' => __( 'Background', 'woolentor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li',
]
);
$this->add_responsive_control(
'product_action_button_normal_padding',
[
'label' => __( 'Padding', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'product_action_button_normal_margin',
[
'label' => __( 'Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'product_action_button_normal_button_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li',
]
);
$this->add_responsive_control(
'product_action_button_border_radius',
[
'label' => __( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'product_action_button_width',
[
'label' => __( 'Width', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 30,
],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a' => 'width: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'product_action_button_height',
[
'label' => __( 'Height', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 200,
'step' => 1,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => 'px',
'size' => 30,
],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li a' => 'height: {{SIZE}}{{UNIT}};',
],
]
);
$this->end_controls_tab();
// Hover
$this->start_controls_tab(
'product_action_button_style_hover_tab',
[
'label' => __( 'Hover', 'woolentor' ),
]
);
$this->add_control(
'product_action_button_hover_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'btn_hover_color','woolentor_style_tabs', '#dc9a0e' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li:hover a' => 'color: {{VALUE}};',
'{{WRAPPER}} .ht-product-action .yith-wcwl-wishlistaddedbrowse a, .ht-product-action .yith-wcwl-wishlistexistsbrowse a' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'product_action_button_hover_background_color',
'label' => __( 'Background', 'woolentor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li:hover',
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'product_action_button_hover_button_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-action ul li:hover',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
// Style Countdown tab section
$this->start_controls_section(
'universal_product_counter_style_section',
[
'label' => __( 'Offer Price Countdown', 'woolentor' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition'=>[
'show_countdown'=>'yes',
]
]
);
$this->add_control(
'product_counter_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' => woolentor_get_option( 'counter_color','woolentor_style_tabs', '#ffffff' ),
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-countdown-wrap .ht-product-countdown .cd-single .cd-single-inner h3' => 'color: {{VALUE}};',
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-countdown-wrap .ht-product-countdown .cd-single .cd-single-inner p' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'product_counter_background_color',
'label' => __( 'Counter Background', 'woolentor' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-countdown-wrap .ht-product-countdown .cd-single .cd-single-inner,{{WRAPPER}} .ht-products .ht-product.ht-product-countdown-fill .ht-product-inner .ht-product-countdown-wrap .ht-product-countdown',
]
);
$this->add_responsive_control(
'product_counter_space_between',
[
'label' => __( 'Space', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-products .ht-product .ht-product-inner .ht-product-countdown-wrap .ht-product-countdown .cd-single' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_section();
// Slider Button style
$this->start_controls_section(
'products-slider-controller-style',
[
'label' => esc_html__( 'Slider Controller Style', 'woolentor' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'product_layout_style' => 'slider',
]
]
);
$this->start_controls_tabs('product_sliderbtn_style_tabs');
// Slider Button style Normal
$this->start_controls_tab(
'product_sliderbtn_style_normal_tab',
[
'label' => __( 'Normal', 'woolentor' ),
]
);
$this->add_control(
'button_style_heading',
[
'label' => __( 'Navigation Arrow', 'woolentor' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_responsive_control(
'nvigation_position',
[
'label' => __( 'Position', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
'step' => 5,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 50,
],
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow' => 'top: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'button_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#dddddd',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_bg_color',
[
'label' => __( 'Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ffffff',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'button_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .product-slider .slick-arrow',
]
);
$this->add_responsive_control(
'button_border_radius',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->add_responsive_control(
'button_padding',
[
'label' => __( 'Padding', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_control(
'button_style_dots_heading',
[
'label' => __( 'Navigation Dots', 'woolentor' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_responsive_control(
'dots_position',
[
'label' => __( 'Position', 'woolentor' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', '%' ],
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
'step' => 5,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 50,
],
'selectors' => [
'{{WRAPPER}} .product-slider .slick-dots' => 'left: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'dots_bg_color',
[
'label' => __( 'Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ffffff',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-dots li button' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'dots_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .product-slider .slick-dots li button',
]
);
$this->add_responsive_control(
'dots_border_radius',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .product-slider .slick-dots li button' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->end_controls_tab();// Normal button style end
// Button style Hover
$this->start_controls_tab(
'product_sliderbtn_style_hover_tab',
[
'label' => __( 'Hover', 'woolentor' ),
]
);
$this->add_control(
'button_style_arrow_heading',
[
'label' => __( 'Navigation', 'woolentor' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'button_hover_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#23252a',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow:hover' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_hover_bg_color',
[
'label' => __( 'Background', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ffffff',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow:hover' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'button_hover_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .product-slider .slick-arrow:hover',
]
);
$this->add_responsive_control(
'button_hover_border_radius',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .product-slider .slick-arrow:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->add_control(
'button_style_dotshov_heading',
[
'label' => __( 'Navigation Dots', 'woolentor' ),
'type' => Controls_Manager::HEADING,
]
);
$this->add_control(
'dots_hover_bg_color',
[
'label' => __( 'Background Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#282828',
'selectors' => [
'{{WRAPPER}} .product-slider .slick-dots li button:hover' => 'background-color: {{VALUE}} !important;',
'{{WRAPPER}} .product-slider .slick-dots li.slick-active button' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'dots_border_hover',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .product-slider .slick-dots li button:hover',
]
);
$this->add_responsive_control(
'dots_border_radius_hover',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .product-slider .slick-dots li button:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->end_controls_tab();// Hover button style end
$this->end_controls_tabs();
$this->end_controls_section(); // Tab option end
// Product Tab menu setting
$this->start_controls_section(
'woolentor-products-tab-menu',
[
'label' => esc_html__( 'Tab Menu Style', 'woolentor' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [
'product_layout_style' => 'tab',
]
]
);
$this->add_responsive_control(
'woolentor-tab-menu-align',
[
'label' => __( 'Alignment', 'woolentor' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'woolentor' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'woolentor' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'woolentor' ),
'icon' => 'fa fa-align-right',
],
'justify' => [
'title' => __( 'Justified', 'woolentor' ),
'icon' => 'fa fa-align-justify',
],
],
'selectors' => [
'{{WRAPPER}} .product-tab-list.ht-text-center' => 'text-align: {{VALUE}};',
],
'default' => 'center',
'separator' =>'after',
]
);
$this->add_responsive_control(
'product_tab_menu_area_margin',
[
'label' => __( 'Tab Menu Area Margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-tab-menus' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->start_controls_tabs('product_tab_style_tabs');
// Tab menu style Normal
$this->start_controls_tab(
'product_tab_style_normal_tab',
[
'label' => __( 'Normal', 'woolentor' ),
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'tabmenutypography',
'scheme' => Scheme_Typography::TYPOGRAPHY_1,
'selector' => '{{WRAPPER}} .ht-tab-menus li a',
]
);
$this->add_control(
'tab_menu_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#23252a',
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'product_tab_menu_bg_color',
[
'label' => __( 'Product tab menu background', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ffffff',
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'tabmenu_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-tab-menus li a',
]
);
$this->add_responsive_control(
'tabmenu_border_radius',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->add_responsive_control(
'product_tab_menu_padding',
[
'label' => __( 'Tab Menu padding', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_responsive_control(
'product_tab_menu_margin',
[
'label' => __( 'Tab Menu margin', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em' ],
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->end_controls_tab();// Normal tab menu style end
// Tab menu style Hover
$this->start_controls_tab(
'product_tab_style_hover_tab',
[
'label' => __( 'Hover', 'woolentor' ),
]
);
$this->add_control(
'tab_menu_hover_color',
[
'label' => __( 'Color', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#23252a',
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a:hover' => 'color: {{VALUE}};',
'{{WRAPPER}} .ht-tab-menus li a.htactive' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'product_tab_menu_hover_bg_color',
[
'label' => __( 'Product tab menu background', 'woolentor' ),
'type' => Controls_Manager::COLOR,
'default' =>'#ffffff',
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a:hover' => 'background-color: {{VALUE}} !important;',
'{{WRAPPER}} .ht-tab-menus li a.htactive' => 'background-color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'tabmenu_hover_border',
'label' => __( 'Border', 'woolentor' ),
'selector' => '{{WRAPPER}} .ht-tab-menus li a:hover',
'selector' => '{{WRAPPER}} .ht-tab-menus li a.htactive',
]
);
$this->add_responsive_control(
'tabmenu_hover_border_radius',
[
'label' => esc_html__( 'Border Radius', 'woolentor' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .ht-tab-menus li a:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
'{{WRAPPER}} .ht-tab-menus li a.htactive' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
],
]
);
$this->end_controls_tab();// Hover tab menu style end
$this->end_controls_tabs();
$this->end_controls_section(); // Tab option end
}
protected function render( $instance = [] ) {
$settings = $this->get_settings_for_display();
$product_type = $this->get_settings_for_display('woolentor_product_grid_product_filter');
$per_page = $this->get_settings_for_display('woolentor_product_grid_products_count');
$custom_order_ck = $this->get_settings_for_display('woolentor_custom_order');
$orderby = $this->get_settings_for_display('orderby');
$order = $this->get_settings_for_display('order');
$tabuniqid = $this->get_id();
$columns = $this->get_settings_for_display('woolentor_product_grid_column');
// Query Argument
$args = array(
'post_type' => 'product',
'post_status' => 'publish',
'ignore_sticky_posts' => 1,
'posts_per_page' => $per_page,
);
switch( $product_type ){
case 'sale':
$args['post__in'] = array_merge( array( 0 ), wc_get_product_ids_on_sale() );
break;
case 'featured':
$args['tax_query'][] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);
break;
case 'best_selling':
$args['meta_key'] = 'total_sales';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'desc';
break;
case 'top_rated':
$args['meta_key'] = '_wc_average_rating';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'desc';
break;
case 'mixed_order':
$args['orderby'] = 'rand';
break;
case 'show_byid':
$args['post__in'] = $settings['woolentor_product_id'];
break;
case 'show_byid_manually':
$args['post__in'] = explode( ',', $settings['woolentor_product_ids_manually'] );
break;
default: /* Recent */
$args['orderby'] = 'date';
$args['order'] = 'desc';
break;
}
// Custom Order
if( $custom_order_ck == 'yes' ){
$args['orderby'] = $orderby;
$args['order'] = $order;
}
$get_product_categories = $settings['woolentor_product_grid_categories']; // get custom field value
$product_cats = str_replace(' ', '', $get_product_categories);
if ( "0" != $get_product_categories) {
if( is_array($product_cats) && count($product_cats) > 0 ){
$field_name = is_numeric($product_cats[0])?'term_id':'slug';
$args['tax_query'][] = array(
array(
'taxonomy' => 'product_cat',
'terms' => $product_cats,
'field' => $field_name,
'include_children' => false
)
);
}
}
$products = new \WP_Query( $args );
// Calculate Column
$collumval = ( $settings['product_layout_style'] == 'slider' ) ? 'ht-product mb-30 product ht-col-xs-12' : 'ht-product ht-col-lg-4 ht-col-md-6 ht-col-sm-6 ht-col-xs-12 mb-30 product';
if( $columns !='' ){
if( $columns == 5 ){
$collumval = 'ht-product cus-col-5 ht-col-md-6 ht-col-sm-6 ht-col-xs-12 mb-30 product';
}else{
$colwidth = round( 12 / $columns );
$collumval = 'ht-product ht-col-lg-'.$colwidth.' ht-col-md-6 ht-col-sm-6 ht-col-xs-12 mb-30 product';
}
}
// Action Button Style
if( $settings['action_button_style'] == 2 ){
$collumval .= ' ht-product-action-style-2';
}elseif( $settings['action_button_style'] == 3 ){
$collumval .= ' ht-product-action-style-2 ht-product-action-round';
}else{
$collumval = $collumval;
}
// Position Action Button
if( $settings['action_button_position'] == 'right' ){
$collumval .= ' ht-product-action-right';
}elseif( $settings['action_button_position'] == 'bottom' ){
$collumval .= ' ht-product-action-bottom';
}elseif( $settings['action_button_position'] == 'middle' ){
$collumval .= ' ht-product-action-middle';
}elseif( $settings['action_button_position'] == 'contentbottom' ){
$collumval .= ' ht-product-action-bottom-content';
}else{
$collumval = $collumval;
}
// Show Action
if( $settings['action_button_show_on'] == 'hover' ){
$collumval .= ' ht-product-action-on-hover';
}
// Content Style
if( $settings['product_content_style'] == 2 ){
$collumval .= ' ht-product-category-right-bottom';
}elseif( $settings['product_content_style'] == 3 ){
$collumval .= ' ht-product-ratting-top-right';
}elseif( $settings['product_content_style'] == 4 ){
$collumval .= ' ht-product-content-allcenter';
}else{
$collumval = $collumval;
}
// Position countdown
if( $settings['product_countdown_position'] == 'left' ){
$collumval .= ' ht-product-countdown-left';
}elseif( $settings['product_countdown_position'] == 'right' ){
$collumval .= ' ht-product-countdown-right';
}elseif( $settings['product_countdown_position'] == 'middle' ){
$collumval .= ' ht-product-countdown-middle';
}elseif( $settings['product_countdown_position'] == 'bottom' ){
$collumval .= ' ht-product-countdown-bottom';
}elseif( $settings['product_countdown_position'] == 'contentbottom' ){
$collumval .= ' ht-product-countdown-content-bottom';
}else{
$collumval = $collumval;
}
// Countdown Gutter
if( $settings['show_countdown_gutter'] != 'yes' ){
$collumval .= ' ht-product-countdown-fill';
}
// Countdown Custom Label
if( $settings['show_countdown'] == 'yes' ){
$data_customlavel = [];
$data_customlavel['daytxt'] = ! empty( $settings['customlabel_days'] ) ? $settings['customlabel_days'] : 'Days';
$data_customlavel['hourtxt'] = ! empty( $settings['customlabel_hours'] ) ? $settings['customlabel_hours'] : 'Hours';
$data_customlavel['minutestxt'] = ! empty( $settings['customlabel_minutes'] ) ? $settings['customlabel_minutes'] : 'Min';
$data_customlavel['secondstxt'] = ! empty( $settings['customlabel_seconds'] ) ? $settings['customlabel_seconds'] : 'Sec';
}
// Slider Options
$is_rtl = is_rtl();
$direction = $is_rtl ? 'rtl' : 'ltr';
$slider_settings = [
'arrows' => ('yes' === $settings['slarrows']),
'dots' => ('yes' === $settings['sldots']),
'autoplay' => ('yes' === $settings['slautolay']),
'autoplay_speed' => absint($settings['slautoplay_speed']),
'animation_speed' => absint($settings['slanimation_speed']),
'pause_on_hover' => ('yes' === $settings['slpause_on_hover']),
'rtl' => $is_rtl,
];
$slider_responsive_settings = [
'product_items' => $settings['slitems'],
'scroll_columns' => $settings['slscroll_columns'],
'tablet_width' => $settings['sltablet_width'],
'tablet_display_columns' => $settings['sltablet_display_columns'],
'tablet_scroll_columns' => $settings['sltablet_scroll_columns'],
'mobile_width' => $settings['slmobile_width'],
'mobile_display_columns' => $settings['slmobile_display_columns'],
'mobile_scroll_columns' => $settings['slmobile_scroll_columns'],
];
$slider_settings = array_merge( $slider_settings, $slider_responsive_settings );
// Action Button
$this->add_render_attribute( 'action_btn_attr', 'class', 'woolentor-action-btn-area' );
if( $settings['addtocart_button_txt'] == 'yes' ){
$this->add_render_attribute( 'action_btn_attr', 'class', 'woolentor-btn-text-cart' );
}
?>
<?php if ( $settings['product_layout_style'] == 'tab' ) { ?>
<div class="product-tab-list ht-text-center">
<ul class="ht-tab-menus">
<?php
$m=0;
if( is_array( $product_cats ) && count( $product_cats ) > 0 ){
// Category retrive
$catargs = array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => true,
'slug' => $product_cats,
);
$prod_categories = get_terms( 'product_cat', $catargs );
foreach( $prod_categories as $prod_cats ){
$m++;
$field_name = is_numeric( $product_cats[0] ) ? 'term_id' : 'slug';
$args['tax_query'] = array(
array(
'taxonomy' => 'product_cat',
'terms' => $prod_cats,
'field' => $field_name,
'include_children' => false
),
);
if( 'featured' == $product_type ){
$args['tax_query'][] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);
}
$fetchproduct = new \WP_Query( $args );
if( $fetchproduct->have_posts() ){
?>
<li><a class="<?php if($m==1){ echo 'htactive';}?>" href="#woolentortab<?php echo $tabuniqid.esc_attr($m);?>">
<?php echo esc_attr( $prod_cats->name,'woolentor' );?>
</a></li>
<?php
}
}
}
?>
</ul>
</div>
<?php }; ?>
<?php if( is_array( $product_cats ) && (count( $product_cats ) > 0) && ( $settings['product_layout_style'] == 'tab' ) ): ?>
<div class="ht-products woocommerce">
<?php
$z=0;
$tabcatargs = array(
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => true,
'slug' => $product_cats,
);
$tabcat_fach = get_terms( 'product_cat', $tabcatargs );
foreach( $tabcat_fach as $cats ):
$z++;
$field_name = is_numeric( $product_cats[0] ) ? 'term_id' : 'slug';
$args['tax_query'] = array(
array(
'taxonomy' => 'product_cat',
'terms' => $cats,
'field' => $field_name,
'include_children' => false
),
);
if( 'featured' == $product_type ){
$args['tax_query'][] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured',
'operator' => 'IN',
);
}
$products = new \WP_Query( $args );
if( $products->have_posts() ):
?>
<div class="ht-tab-pane <?php if( $z==1 ){ echo 'htactive'; } ?>" id="<?php echo 'woolentortab'.$tabuniqid.$z;?>">
<div class="ht-row">
<?php
while( $products->have_posts() ): $products->the_post();
// Sale Schedule
$offer_start_date_timestamp = get_post_meta( get_the_ID(), '_sale_price_dates_from', true );
$offer_start_date = $offer_start_date_timestamp ? date_i18n( 'Y/m/d', $offer_start_date_timestamp ) : '';
$offer_end_date_timestamp = get_post_meta( get_the_ID(), '_sale_price_dates_to', true );
$offer_end_date = $offer_end_date_timestamp ? date_i18n( 'Y/m/d', $offer_end_date_timestamp ) : '';
// Gallery Image
global $product;
$gallery_images_ids = $product->get_gallery_image_ids() ? $product->get_gallery_image_ids() : array();
if ( has_post_thumbnail() ){
array_unshift( $gallery_images_ids, $product->get_image_id() );
}
?>
<!--Product Start-->
<div <?php wc_product_class( $collumval ); ?>>
<div class="ht-product-inner">
<div class="ht-product-image-wrap">
<?php
if( class_exists('WooCommerce') ){
woolentor_custom_product_badge();
woolentor_sale_flash();
}
?>
<div class="ht-product-image">
<?php if( $settings['thumbnails_style'] == 2 && $gallery_images_ids ): ?>
<div class="ht-product-image-slider ht-product-image-thumbnaisl-<?php echo $tabuniqid; ?>">
<?php
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
echo '<a href="'.esc_url( get_the_permalink() ).'" class="item">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_thumbnail' ).'</a>';
}
?>
</div>
<?php elseif( $settings['thumbnails_style'] == 3 && $gallery_images_ids ) : $tabactive = ''; ?>
<div class="ht-product-cus-tab">
<?php
$i = 0;
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
$i++;
if( $i == 1 ){ $tabactive = 'htactive'; }else{ $tabactive = ' '; }
echo '<div class="ht-product-cus-tab-pane '.$tabactive.'" id="image-'.$i.get_the_ID().'"><a href="'.esc_url( get_the_permalink() ).'">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_thumbnail' ).'</a></div>';
}
?>
</div>
<ul class="ht-product-cus-tab-links">
<?php
$j = 0;
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
$j++;
if( $j == 1 ){ $tabactive = 'htactive'; }else{ $tabactive = ' '; }
echo '<li><a href="#image-'.$j.get_the_ID().'" class="'.$tabactive.'">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_gallery_thumbnail' ).'</a></li>';
}
?>
</ul>
<?php else: ?>
<a href="<?php the_permalink();?>">
<?php woocommerce_template_loop_product_thumbnail(); ?>
</a>
<?php endif; ?>
</div>
<?php if( $settings['show_countdown'] == 'yes' && $settings['product_countdown_position'] != 'contentbottom' && $offer_end_date != '' ):
if( $offer_start_date_timestamp && $offer_end_date_timestamp && current_time( 'timestamp' ) > $offer_start_date_timestamp && current_time( 'timestamp' ) < $offer_end_date_timestamp
):
?>
<div class="ht-product-countdown-wrap">
<div class="ht-product-countdown" data-countdown="<?php echo esc_attr( $offer_end_date ); ?>" data-customlavel='<?php echo wp_json_encode( $data_customlavel ) ?>'></div>
</div>
<?php endif; endif; ?>
<?php if( $settings['show_action_button'] == 'yes' ){ if( $settings['action_button_position'] != 'contentbottom' ): ?>
<div class="ht-product-action">
<ul <?php echo $this->get_render_attribute_string( 'action_btn_attr' ); ?>>
<li>
<a href="javascript:void(0);" class="woolentorquickview" data-quick-id="<?php the_ID();?>" >
<i class="sli sli-magnifier"></i>
<span class="ht-product-action-tooltip"><?php esc_html_e('Quick View','woolentor'); ?></span>
</a>
</li>
<?php
if( true === woolentor_has_wishlist_plugin() ){
echo '<li>'.woolentor_add_to_wishlist_button('<i class="sli sli-heart"></i>','<i class="sli sli-heart"></i>', 'yes').'</li>';
}
?>
<?php
if( function_exists('woolentor_compare_button') && true === woolentor_exist_compare_plugin() ){
echo '<li>';
woolentor_compare_button(
array(
'style'=>2,
'btn_text'=>'<i class="sli sli-refresh"></i>',
'btn_added_txt'=>'<i class="sli sli-check"></i>'
)
);
echo '</li>';
}
?>
<li class="woolentor-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
</ul>
</div>
<?php endif; } ?>
</div>
<div class="ht-product-content">
<div class="ht-product-content-inner">
<div class="ht-product-categories"><?php woolentor_get_product_category_list(); ?></div>
<h4 class="ht-product-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<div class="ht-product-price"><?php woocommerce_template_loop_price();?></div>
<div class="ht-product-ratting-wrap"><?php echo woolentor_wc_get_rating_html(); ?></div>
<?php if( $settings['show_action_button'] == 'yes' ){ if( $settings['action_button_position'] == 'contentbottom' ): ?>
<div class="ht-product-action">
<ul <?php echo $this->get_render_attribute_string( 'action_btn_attr' ); ?>>
<li>
<a href="javascript:void(0);" class="woolentorquickview" data-quick-id="<?php the_ID();?>" >
<i class="sli sli-magnifier"></i>
<span class="ht-product-action-tooltip"><?php esc_html_e('Quick View','woolentor'); ?></span>
</a>
</li>
<?php
if( true === woolentor_has_wishlist_plugin() ){
echo '<li>'.woolentor_add_to_wishlist_button('<i class="sli sli-heart"></i>','<i class="sli sli-heart"></i>', 'yes').'</li>';
}
?>
<?php
if( function_exists('woolentor_compare_button') && true === woolentor_exist_compare_plugin() ){
echo '<li>';
woolentor_compare_button(
array(
'style'=>2,
'btn_text'=>'<i class="sli sli-refresh"></i>',
'btn_added_txt'=>'<i class="sli sli-check"></i>'
)
);
echo '</li>';
}
?>
<li class="woolentor-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
</ul>
</div>
<?php endif; } ?>
</div>
<?php
if( $settings['show_countdown'] == 'yes' && $settings['product_countdown_position'] == 'contentbottom' && $offer_end_date != '' ):
if( $offer_start_date_timestamp && $offer_end_date_timestamp && current_time( 'timestamp' ) > $offer_start_date_timestamp && current_time( 'timestamp' ) < $offer_end_date_timestamp
):
?>
<div class="ht-product-countdown-wrap">
<div class="ht-product-countdown" data-countdown="<?php echo esc_attr( $offer_end_date ); ?>" data-customlavel='<?php echo wp_json_encode( $data_customlavel ) ?>'></div>
</div>
<?php endif; endif; ?>
</div>
</div>
</div>
<!--Product End-->
<?php endwhile; wp_reset_query(); wp_reset_postdata(); ?>
</div>
</div>
<?php endif; endforeach; ?>
</div>
<?php else: ?>
<?php if( $settings['product_layout_style'] == 'slider' ){ echo '<div class="ht-row">'; } ?>
<div class="ht-products woocommerce <?php if( $settings['product_layout_style'] == 'slider' ){ echo esc_attr( 'product-slider' ); } else{ echo 'ht-row'; } ?>" dir="<?php echo $direction; ?>" data-settings='<?php if( $settings['product_layout_style'] == 'slider' ){ echo wp_json_encode( $slider_settings ); } ?>'>
<?php
if( $products->have_posts() ):
while( $products->have_posts() ): $products->the_post();
// Sale Schedule
$offer_start_date_timestamp = get_post_meta( get_the_ID(), '_sale_price_dates_from', true );
$offer_start_date = $offer_start_date_timestamp ? date_i18n( 'Y/m/d', $offer_start_date_timestamp ) : '';
$offer_end_date_timestamp = get_post_meta( get_the_ID(), '_sale_price_dates_to', true );
$offer_end_date = $offer_end_date_timestamp ? date_i18n( 'Y/m/d', $offer_end_date_timestamp ) : '';
// Gallery Image
global $product;
$gallery_images_ids = $product->get_gallery_image_ids() ? $product->get_gallery_image_ids() : array();
if ( has_post_thumbnail() ){
array_unshift( $gallery_images_ids, $product->get_image_id() );
}
?>
<!--Product Start-->
<div class="<?php echo $collumval; ?>">
<div class="ht-product-inner">
<div class="ht-product-image-wrap">
<?php
if( class_exists('WooCommerce') ){
woolentor_custom_product_badge();
woolentor_sale_flash();
}
?>
<div class="ht-product-image">
<?php if( $settings['thumbnails_style'] == 2 && $gallery_images_ids ): ?>
<div class="ht-product-image-slider ht-product-image-thumbnaisl-<?php echo $tabuniqid; ?>" data-slick='{"rtl":<?php if( is_rtl() ){ echo 'true'; }else{ echo 'false'; } ?> }'>
<?php
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
echo '<a href="'.esc_url( get_the_permalink() ).'" class="item">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_thumbnail' ).'</a>';
}
?>
</div>
<?php elseif( $settings['thumbnails_style'] == 3 && $gallery_images_ids ) : $tabactive = ''; ?>
<div class="ht-product-cus-tab">
<?php
$i = 0;
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
$i++;
if( $i == 1 ){ $tabactive = 'htactive'; }else{ $tabactive = ' '; }
echo '<div class="ht-product-cus-tab-pane '.$tabactive.'" id="image-'.$i.get_the_ID().'"><a href="#">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_thumbnail' ).'</a></div>';
}
?>
</div>
<ul class="ht-product-cus-tab-links">
<?php
$j = 0;
foreach ( $gallery_images_ids as $gallery_attachment_id ) {
$j++;
if( $j == 1 ){ $tabactive = 'htactive'; }else{ $tabactive = ' '; }
echo '<li><a href="#image-'.$j.get_the_ID().'" class="'.$tabactive.'">'.wp_get_attachment_image( $gallery_attachment_id, 'woocommerce_gallery_thumbnail' ).'</a></li>';
}
?>
</ul>
<?php else: ?>
<a href="<?php the_permalink();?>">
<?php woocommerce_template_loop_product_thumbnail(); ?>
</a>
<?php endif; ?>
</div>
<?php if( $settings['show_countdown'] == 'yes' && $settings['product_countdown_position'] != 'contentbottom' && $offer_end_date != '' ):
if( $offer_start_date_timestamp && $offer_end_date_timestamp && current_time( 'timestamp' ) > $offer_start_date_timestamp && current_time( 'timestamp' ) < $offer_end_date_timestamp
):
?>
<div class="ht-product-countdown-wrap">
<div class="ht-product-countdown" data-countdown="<?php echo esc_attr( $offer_end_date ); ?>" data-customlavel='<?php echo wp_json_encode( $data_customlavel ) ?>'></div>
</div>
<?php endif; endif; ?>
<?php if( $settings['show_action_button'] == 'yes' ){ if( $settings['action_button_position'] != 'contentbottom' ): ?>
<div class="ht-product-action">
<ul <?php echo $this->get_render_attribute_string( 'action_btn_attr' ); ?>>
<li>
<a href="javascript:void(0);" class="woolentorquickview" data-quick-id="<?php the_ID();?>" >
<i class="sli sli-magnifier"></i>
<span class="ht-product-action-tooltip"><?php esc_html_e('Quick View','woolentor'); ?></span>
</a>
</li>
<?php
if( true === woolentor_has_wishlist_plugin() ){
echo '<li>'.woolentor_add_to_wishlist_button('<i class="sli sli-heart"></i>','<i class="sli sli-heart"></i>', 'yes').'</li>';
}
?>
<?php
if( function_exists('woolentor_compare_button') && true === woolentor_exist_compare_plugin() ){
echo '<li>';
woolentor_compare_button(
array(
'style'=>2,
'btn_text'=>'<i class="sli sli-refresh"></i>',
'btn_added_txt'=>'<i class="sli sli-check"></i>'
)
);
echo '</li>';
}
?>
<li class="woolentor-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
</ul>
</div>
<?php endif; }?>
</div>
<div class="ht-product-content">
<div class="ht-product-content-inner">
<div class="ht-product-categories"><?php woolentor_get_product_category_list(); ?></div>
<h4 class="ht-product-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<div class="ht-product-price"><?php woocommerce_template_loop_price();?></div>
<div class="ht-product-ratting-wrap"><?php echo woolentor_wc_get_rating_html(); ?></div>
<?php if( $settings['show_action_button'] == 'yes' ){ if( $settings['action_button_position'] == 'contentbottom' ): ?>
<div class="ht-product-action">
<ul <?php echo $this->get_render_attribute_string( 'action_btn_attr' ); ?>>
<li>
<a href="javascript:void(0);" class="woolentorquickview" data-quick-id="<?php the_ID();?>" >
<i class="sli sli-magnifier"></i>
<span class="ht-product-action-tooltip"><?php esc_html_e('Quick View','woolentor'); ?></span>
</a>
</li>
<?php
if( true === woolentor_has_wishlist_plugin() ){
echo '<li>'.woolentor_add_to_wishlist_button('<i class="sli sli-heart"></i>','<i class="sli sli-heart"></i>', 'yes').'</li>';
}
?>
<?php
if( function_exists('woolentor_compare_button') && true === woolentor_exist_compare_plugin() ){
echo '<li>';
woolentor_compare_button(
array(
'style'=>2,
'btn_text'=>'<i class="sli sli-refresh"></i>',
'btn_added_txt'=>'<i class="sli sli-check"></i>'
)
);
echo '</li>';
}
?>
<li class="woolentor-cart"><?php woocommerce_template_loop_add_to_cart(); ?></li>
</ul>
</div>
<?php endif; } ?>
</div>
<?php
if( $settings['show_countdown'] == 'yes' && $settings['product_countdown_position'] == 'contentbottom' && $offer_end_date != '' ):
if( $offer_start_date_timestamp && $offer_end_date_timestamp && current_time( 'timestamp' ) > $offer_start_date_timestamp && current_time( 'timestamp' ) < $offer_end_date_timestamp
):
?>
<div class="ht-product-countdown-wrap">
<div class="ht-product-countdown" data-countdown="<?php echo esc_attr( $offer_end_date ); ?>" data-customlavel='<?php echo wp_json_encode( $data_customlavel ) ?>'></div>
</div>
<?php endif; endif; ?>
</div>
</div>
</div>
<!--Product End-->
<?php endwhile; wp_reset_query(); wp_reset_postdata(); endif; ?>
</div>
<?php if( $settings['product_layout_style'] == 'slider' ){ echo '</div>'; } ?>
<?php endif; ?>
<?php if ( Plugin::instance()->editor->is_edit_mode() ) { ?>
<script>
;jQuery(document).ready(function($) {
'use strict';
$(".ht-product-image-thumbnaisl-<?php echo $tabuniqid; ?>").slick({
dots: true,
arrows: true,
prevArrow: '<button class="slick-prev"><i class="sli sli-arrow-left"></i></button>',
nextArrow: '<button class="slick-next"><i class="sli sli-arrow-right"></i></button>',
});
});
</script>
<?php } ?>
<?php
}
}
Plugin::instance()->widgets_manager->register_widget_type( new Woolentor_Universal_Product_Layout_Widget() );