Adv_Accordion.php
1 year ago
Adv_Tabs.php
1 year ago
Advanced_Data_Table.php
1 year ago
Better_Payment.php
4 years ago
Betterdocs_Category_Box.php
1 year ago
Betterdocs_Category_Grid.php
1 year ago
Betterdocs_Search_Form.php
1 year ago
Business_Reviews.php
1 year ago
Caldera_Forms.php
1 year ago
Career_Page.php
4 years ago
Contact_Form_7.php
1 year ago
Content_Ticker.php
1 year ago
Countdown.php
1 year ago
Creative_Button.php
1 year ago
Cta_Box.php
1 year ago
Data_Table.php
1 year ago
Dual_Color_Header.php
1 year ago
EmbedPress.php
4 years ago
Event_Calendar.php
1 year ago
Facebook_Feed.php
1 year ago
Fancy_Text.php
1 year ago
Feature_List.php
1 year ago
Filterable_Gallery.php
1 year ago
Flip_Box.php
1 year ago
FluentForm.php
1 year ago
Formstack.php
1 year ago
GravityForms.php
1 year ago
Image_Accordion.php
1 year ago
Info_Box.php
1 year ago
Interactive_Circle.php
1 year ago
Login_Register.php
1 year ago
NFT_Gallery.php
1 year ago
NinjaForms.php
1 year ago
Post_Grid.php
1 year ago
Post_Timeline.php
1 year ago
Pricing_Table.php
1 year ago
Product_Grid.php
1 year ago
Progress_Bar.php
1 year ago
SVG_Draw.php
1 year ago
Simple_Menu.php
1 year ago
Sticky_Video.php
1 year ago
Team_Member.php
1 year ago
Testimonial.php
1 year ago
Tooltip.php
1 year ago
Twitter_Feed.php
1 year ago
TypeForm.php
1 year ago
WeForms.php
2 years ago
Woo_Cart.php
1 year ago
Woo_Checkout.php
1 year ago
Woo_Product_Carousel.php
1 year ago
Woo_Product_Compare.php
2 years ago
Woo_Product_Gallery.php
1 year ago
Woo_Product_List.php
1 year ago
WpForms.php
1 year ago
index.php
3 years ago
Woo_Product_Carousel.php
3515 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Elements; |
| 4 | |
| 5 | // If this file is called directly, abort. |
| 6 | if ( !defined( 'ABSPATH' ) ) { |
| 7 | exit; |
| 8 | } |
| 9 | |
| 10 | use Elementor\Controls_Manager; |
| 11 | use Elementor\Group_Control_Background; |
| 12 | use Elementor\Group_Control_Border; |
| 13 | use Elementor\Group_Control_Box_Shadow; |
| 14 | use Elementor\Group_Control_Image_Size; |
| 15 | use Elementor\Group_Control_Typography; |
| 16 | use Elementor\Plugin; |
| 17 | use Elementor\Widget_Base; |
| 18 | |
| 19 | use Essential_Addons_Elementor\Traits\Helper; |
| 20 | use Essential_Addons_Elementor\Classes\Helper as HelperClass; |
| 21 | |
| 22 | class Woo_Product_Carousel extends Widget_Base { |
| 23 | use Helper; |
| 24 | |
| 25 | /** |
| 26 | * @var int |
| 27 | */ |
| 28 | protected $page_id; |
| 29 | |
| 30 | public function __construct( $data = [], $args = null ) { |
| 31 | parent::__construct( $data, $args ); |
| 32 | |
| 33 | $is_type_instance = $this->is_type_instance(); |
| 34 | |
| 35 | if ( !$is_type_instance && null === $args ) { |
| 36 | throw new \Exception( '`$args` argument is required when initializing a full widget instance.' ); |
| 37 | } |
| 38 | |
| 39 | if ( $is_type_instance && class_exists( 'woocommerce' ) ) { |
| 40 | $this->load_quick_view_asset(); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * get widget name |
| 46 | * |
| 47 | * Retrieve Woo Product Carousel widget name. |
| 48 | * |
| 49 | * @return string |
| 50 | */ |
| 51 | public function get_name() { |
| 52 | return 'eael-woo-product-carousel'; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * get widget title |
| 57 | * |
| 58 | * Retrieve Woo Product Carousel widget title. |
| 59 | * |
| 60 | * @return string |
| 61 | */ |
| 62 | public function get_title() { |
| 63 | return esc_html__( 'Woo Product Carousel', 'essential-addons-for-elementor-lite' ); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * get widget icon |
| 68 | * |
| 69 | * Retrieve Woo Product Carousel widget icon. |
| 70 | * |
| 71 | * @return string |
| 72 | */ |
| 73 | public function get_icon() { |
| 74 | return 'eaicon-product-carousel'; |
| 75 | } |
| 76 | |
| 77 | public function get_categories() { |
| 78 | return [ 'essential-addons-for-elementor-lite', 'woocommerce-elements' ]; |
| 79 | } |
| 80 | |
| 81 | /** |
| 82 | * get widget keywords |
| 83 | * |
| 84 | * Retrieve list of keywords the widget belongs to. |
| 85 | * |
| 86 | * @return string[] |
| 87 | */ |
| 88 | public function get_keywords() { |
| 89 | return [ |
| 90 | 'woo', |
| 91 | 'woocommerce', |
| 92 | 'ea woocommerce', |
| 93 | 'ea woo product carousel', |
| 94 | 'ea woocommerce product carousel', |
| 95 | 'product gallery', |
| 96 | 'woocommerce carousel', |
| 97 | 'gallery', |
| 98 | 'ea', |
| 99 | 'essential addons', |
| 100 | ]; |
| 101 | } |
| 102 | |
| 103 | public function get_custom_help_url() { |
| 104 | return 'https://essential-addons.com/elementor/docs/woo-product-carousel/'; |
| 105 | } |
| 106 | |
| 107 | public function get_style_depends() { |
| 108 | return [ |
| 109 | 'font-awesome-5-all', |
| 110 | 'font-awesome-4-shim', |
| 111 | ]; |
| 112 | } |
| 113 | |
| 114 | public function get_script_depends() { |
| 115 | return [ |
| 116 | 'font-awesome-4-shim', |
| 117 | ]; |
| 118 | } |
| 119 | |
| 120 | protected function eael_get_product_orderby_options() { |
| 121 | return apply_filters( 'eael/woo-product-carousel/orderby-options', [ |
| 122 | 'ID' => __( 'Product ID', 'essential-addons-for-elementor-lite' ), |
| 123 | 'title' => __( 'Product Title', 'essential-addons-for-elementor-lite' ), |
| 124 | '_price' => __( 'Price', 'essential-addons-for-elementor-lite' ), |
| 125 | '_sku' => __( 'SKU', 'essential-addons-for-elementor-lite' ), |
| 126 | 'date' => __( 'Date', 'essential-addons-for-elementor-lite' ), |
| 127 | 'modified' => __( 'Last Modified Date', 'essential-addons-for-elementor-lite' ), |
| 128 | 'parent' => __( 'Parent Id', 'essential-addons-for-elementor-lite' ), |
| 129 | 'rand' => __( 'Random', 'essential-addons-for-elementor-lite' ), |
| 130 | 'menu_order' => __( 'Menu Order', 'essential-addons-for-elementor-lite' ), |
| 131 | ] ); |
| 132 | } |
| 133 | |
| 134 | protected function eael_get_product_filterby_options() { |
| 135 | return apply_filters( 'eael/woo-product-carousel/filterby-options', [ |
| 136 | 'recent-products' => esc_html__( 'Recent Products', 'essential-addons-for-elementor-lite' ), |
| 137 | 'featured-products' => esc_html__( 'Featured Products', 'essential-addons-for-elementor-lite' ), |
| 138 | 'best-selling-products' => esc_html__( 'Best Selling Products', 'essential-addons-for-elementor-lite' ), |
| 139 | 'sale-products' => esc_html__( 'Sale Products', 'essential-addons-for-elementor-lite' ), |
| 140 | 'top-products' => esc_html__( 'Top Rated Products', 'essential-addons-for-elementor-lite' ), |
| 141 | 'related-products' => esc_html__('Related Products', 'essential-addons-for-elementor-lite'), |
| 142 | 'manual' => esc_html__('Manual Selection', 'essential-addons-for-elementor-lite'), |
| 143 | ] ); |
| 144 | } |
| 145 | |
| 146 | protected function eael_get_product_statuses() { |
| 147 | return apply_filters( 'eael/woo-product-carousel/product-statuses', [ |
| 148 | 'publish' => esc_html__( 'Publish', 'essential-addons-for-elementor-lite' ), |
| 149 | 'draft' => esc_html__( 'Draft', 'essential-addons-for-elementor-lite' ), |
| 150 | 'pending' => esc_html__( 'Pending Review', 'essential-addons-for-elementor-lite' ), |
| 151 | 'future' => esc_html__( 'Schedule', 'essential-addons-for-elementor-lite' ), |
| 152 | ] ); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Register Woo Product carousel widget controls. |
| 157 | * |
| 158 | * Adds different input fields to allow the user to change and customize the widget settings. |
| 159 | * |
| 160 | * register_controls |
| 161 | */ |
| 162 | protected function register_controls() { |
| 163 | $this->init_content_wc_notice_controls(); |
| 164 | if ( !function_exists( 'WC' ) ) { |
| 165 | return; |
| 166 | } |
| 167 | // Content Controls |
| 168 | $this->eael_woo_product_carousel_layout(); |
| 169 | $this->eael_woo_product_carousel_content(); |
| 170 | $this->eael_woo_product_carousel_options(); |
| 171 | $this->eael_woo_product_carousel_query(); |
| 172 | |
| 173 | $this->eael_product_action_buttons(); |
| 174 | $this->eael_product_badges(); |
| 175 | |
| 176 | // Style Controls--------------- |
| 177 | $this->init_style_product_controls(); |
| 178 | $this->style_color_typography(); |
| 179 | |
| 180 | $this->eael_woo_product_carousel_buttons_style(); |
| 181 | $this->eael_product_view_popup_style(); |
| 182 | $this->eael_woo_product_carousel_dots(); |
| 183 | $this->eael_woo_product_carousel_image_dots(); |
| 184 | $this->eael_woo_product_carousel_arrows(); |
| 185 | do_action( 'eael/controls/nothing_found_style', $this ); |
| 186 | } |
| 187 | |
| 188 | protected function init_content_wc_notice_controls() { |
| 189 | if ( ! function_exists( 'WC' ) ) { |
| 190 | $this->start_controls_section( 'eael_global_warning', [ |
| 191 | 'label' => __( 'Warning!', 'essential-addons-for-elementor-lite' ), |
| 192 | ] ); |
| 193 | $this->add_control( 'eael_global_warning_text', [ |
| 194 | 'type' => Controls_Manager::RAW_HTML, |
| 195 | 'raw' => __( '<strong>WooCommerce</strong> is not installed/activated on your site. Please install and activate <a href="plugin-install.php?s=woocommerce&tab=search&type=term" target="_blank">WooCommerce</a> first.', 'essential-addons-for-elementor-lite' ), |
| 196 | 'content_classes' => 'eael-warning', |
| 197 | ] ); |
| 198 | $this->end_controls_section(); |
| 199 | |
| 200 | return; |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | protected function eael_woo_product_carousel_layout() { |
| 205 | |
| 206 | } |
| 207 | |
| 208 | protected function eael_woo_product_carousel_content() { |
| 209 | |
| 210 | $this->start_controls_section( |
| 211 | 'eael_section_product_carousel_layouts', |
| 212 | [ |
| 213 | 'label' => esc_html__( 'Layout Settings', 'essential-addons-for-elementor-lite' ), |
| 214 | ] |
| 215 | ); |
| 216 | |
| 217 | $layout_options = []; |
| 218 | $template_list = $this->get_template_list_for_dropdown( true ); |
| 219 | |
| 220 | if( ! empty( $template_list ) ){ |
| 221 | $image_dir_url = EAEL_PLUGIN_URL . 'assets/admin/images/layout-previews/'; |
| 222 | $image_dir_path = EAEL_PLUGIN_PATH . 'assets/admin/images/layout-previews/'; |
| 223 | foreach( $template_list as $key => $label ){ |
| 224 | $image_url = $image_dir_url . 'woo-product-carousel-' . $key . '.png'; |
| 225 | $image_url = file_exists( $image_dir_path . 'woo-product-carousel-' . $key . '.png' ) ? $image_url : $image_dir_url . 'custom-layout.png'; |
| 226 | $layout_options[ $key ] = [ |
| 227 | 'title' => $label, |
| 228 | 'image' => $image_url |
| 229 | ]; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | $this->add_control( |
| 234 | 'eael_dynamic_template_layout', |
| 235 | [ |
| 236 | 'label' => esc_html__( 'Layout', 'essential-addons-for-elementor-lite' ), |
| 237 | 'type' => Controls_Manager::CHOOSE, |
| 238 | 'options' => $layout_options, |
| 239 | 'default' => 'preset-1', |
| 240 | 'label_block' => true, |
| 241 | 'toggle' => false, |
| 242 | 'image_choose'=> true, |
| 243 | ] |
| 244 | ); |
| 245 | |
| 246 | $this->add_control( |
| 247 | 'eael_product_carousel_show_title', |
| 248 | [ |
| 249 | 'label' => __('Show Title', 'essential-addons-for-elementor-lite'), |
| 250 | 'type' => Controls_Manager::SWITCHER, |
| 251 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 252 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 253 | 'return_value' => 'yes', |
| 254 | 'default' => 'yes', |
| 255 | ] |
| 256 | ); |
| 257 | |
| 258 | $this->add_control( |
| 259 | 'eael_product_carousel_show_add_to_cart', |
| 260 | [ |
| 261 | 'label' => __('Add to Cart', 'essential-addons-for-elementor-lite'), |
| 262 | 'type' => Controls_Manager::SWITCHER, |
| 263 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 264 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 265 | 'return_value' => 'yes', |
| 266 | 'default' => 'yes', |
| 267 | ] |
| 268 | ); |
| 269 | |
| 270 | $this->add_control( |
| 271 | 'eael_product_carousel_title_tag', |
| 272 | [ |
| 273 | 'label' => __('Title Tag', 'essential-addons-for-elementor-lite'), |
| 274 | 'type' => Controls_Manager::SELECT, |
| 275 | 'default' => 'h2', |
| 276 | 'options' => [ |
| 277 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 278 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 279 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 280 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 281 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 282 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 283 | 'span' => __('Span', 'essential-addons-for-elementor-lite'), |
| 284 | 'p' => __('P', 'essential-addons-for-elementor-lite'), |
| 285 | 'div' => __('Div', 'essential-addons-for-elementor-lite'), |
| 286 | ], |
| 287 | 'condition' => [ |
| 288 | 'eael_product_carousel_show_title' => 'yes', |
| 289 | ], |
| 290 | ] |
| 291 | ); |
| 292 | |
| 293 | $this->add_control( |
| 294 | 'eael_product_carousel_title_length', |
| 295 | [ |
| 296 | 'label' => __('Title Length', 'essential-addons-for-elementor-lite'), |
| 297 | 'type' => Controls_Manager::NUMBER, |
| 298 | 'condition' => [ |
| 299 | 'eael_product_carousel_show_title' => 'yes', |
| 300 | ], |
| 301 | ] |
| 302 | ); |
| 303 | |
| 304 | $this->add_control( |
| 305 | 'eael_product_rating_content_heading', |
| 306 | [ |
| 307 | 'label' => esc_html__( 'Product Rating', 'essential-addons-for-elementor-lite' ), |
| 308 | 'type' => Controls_Manager::HEADING, |
| 309 | 'separator' => 'before', |
| 310 | ] |
| 311 | ); |
| 312 | |
| 313 | $this->add_control( |
| 314 | 'eael_product_carousel_rating', |
| 315 | [ |
| 316 | 'label' => esc_html__( 'Show', 'essential-addons-for-elementor-lite' ), |
| 317 | 'type' => Controls_Manager::SWITCHER, |
| 318 | 'return_value' => 'yes', |
| 319 | 'default' => 'yes', |
| 320 | ] ); |
| 321 | |
| 322 | $this->add_control( |
| 323 | 'eael_rating_count', |
| 324 | [ |
| 325 | 'label' => esc_html__( 'Show Count ?', 'essential-addons-for-elementor-lite' ), |
| 326 | 'type' => Controls_Manager::SWITCHER, |
| 327 | 'return_value' => 'yes', |
| 328 | 'default' => 'no', |
| 329 | 'condition' => [ |
| 330 | 'eael_product_carousel_rating' => 'yes' |
| 331 | ] |
| 332 | ] ); |
| 333 | |
| 334 | $this->add_control( |
| 335 | 'eael_rating_text', |
| 336 | [ |
| 337 | 'label' => esc_html__( 'Text Format', 'essential-addons-for-elementor-lite' ), |
| 338 | 'label_block' => true, |
| 339 | 'type' => Controls_Manager::TEXTAREA, |
| 340 | 'default' => '[avg_user_rating]/[max_rating] ([total_rating])', |
| 341 | 'ai' => [ 'active' => false ], |
| 342 | 'condition' => [ |
| 343 | 'eael_rating_count' => 'yes', |
| 344 | 'eael_product_carousel_rating' => 'yes' |
| 345 | ], |
| 346 | 'description' => __( '<strong>[avg_user_rating]</strong> represents the average user rating. <strong>[max_rating]</strong> is the maximum rating, which is 5. <strong>[total_rating]</strong> indicates the number of ratings provided by users.', 'essential-addons-for-elementor-lite' ) |
| 347 | ] |
| 348 | ); |
| 349 | |
| 350 | $this->add_control( |
| 351 | 'eael_product_carousel_price', |
| 352 | [ |
| 353 | 'label' => esc_html__( 'Show Product Price?', 'essential-addons-for-elementor-lite' ), |
| 354 | 'type' => Controls_Manager::SWITCHER, |
| 355 | 'return_value' => 'yes', |
| 356 | 'default' => 'yes', |
| 357 | 'separator' => 'before', |
| 358 | ] |
| 359 | ); |
| 360 | $this->add_control( |
| 361 | 'eael_product_carousel_excerpt', |
| 362 | [ |
| 363 | 'label' => esc_html__( 'Short Description?', 'essential-addons-for-elementor-lite' ), |
| 364 | 'type' => Controls_Manager::SWITCHER, |
| 365 | 'return_value' => 'yes', |
| 366 | 'default' => 'no', |
| 367 | ] |
| 368 | ); |
| 369 | $this->add_control( |
| 370 | 'eael_product_carousel_excerpt_length', |
| 371 | [ |
| 372 | 'label' => __( 'Excerpt Words', 'essential-addons-for-elementor-lite' ), |
| 373 | 'type' => Controls_Manager::NUMBER, |
| 374 | 'default' => '10', |
| 375 | 'condition' => [ |
| 376 | 'eael_product_carousel_excerpt' => 'yes', |
| 377 | ], |
| 378 | ] |
| 379 | ); |
| 380 | |
| 381 | $this->add_control( |
| 382 | 'eael_product_carousel_excerpt_expanison_indicator', |
| 383 | [ |
| 384 | 'label' => esc_html__( 'Expansion Indicator', 'essential-addons-for-elementor-lite' ), |
| 385 | 'type' => Controls_Manager::TEXT, |
| 386 | 'label_block' => false, |
| 387 | 'default' => '...', |
| 388 | 'condition' => [ |
| 389 | 'eael_product_carousel_excerpt' => 'yes', |
| 390 | ], |
| 391 | 'ai' => [ |
| 392 | 'active' => false, |
| 393 | ], |
| 394 | ] |
| 395 | ); |
| 396 | |
| 397 | $this->add_group_control( |
| 398 | Group_Control_Image_Size::get_type(), |
| 399 | [ |
| 400 | 'name' => 'eael_product_carousel_image_size', |
| 401 | 'exclude' => ['custom'], |
| 402 | 'default' => 'medium', |
| 403 | 'label_block' => true, |
| 404 | ] |
| 405 | ); |
| 406 | |
| 407 | $this->add_control( |
| 408 | 'eael_woo_product_carousel_image_stretch', |
| 409 | [ |
| 410 | 'label' => __( 'Image Stretch', 'essential-addons-for-elementor-lite' ), |
| 411 | 'type' => Controls_Manager::SWITCHER, |
| 412 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 413 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 414 | 'return_value' => 'true', |
| 415 | 'default' => 'yes', |
| 416 | ] |
| 417 | ); |
| 418 | |
| 419 | $this->add_control( |
| 420 | 'eael_post_terms', |
| 421 | [ |
| 422 | 'label' => __( 'Show Terms From', 'essential-addons-for-elementor-lite' ), |
| 423 | 'type' => Controls_Manager::SELECT, |
| 424 | 'options' => [ |
| 425 | 'category' => __( 'Category', 'essential-addons-for-elementor-lite' ), |
| 426 | 'tags' => __( 'Tags', 'essential-addons-for-elementor-lite' ), |
| 427 | ], |
| 428 | 'default' => 'category', |
| 429 | 'condition' => [ |
| 430 | 'eael_show_post_terms' => 'yes', |
| 431 | ], |
| 432 | ] |
| 433 | ); |
| 434 | |
| 435 | $this->add_control( |
| 436 | 'eael_post_terms_max_length', |
| 437 | [ |
| 438 | 'label' => __( 'Max Terms to Show', 'essential-addons-for-elementor-lite' ), |
| 439 | 'type' => Controls_Manager::SELECT, |
| 440 | 'options' => [ |
| 441 | 1 => __( '1', 'essential-addons-for-elementor-lite' ), |
| 442 | 2 => __( '2', 'essential-addons-for-elementor-lite' ), |
| 443 | 3 => __( '3', 'essential-addons-for-elementor-lite' ), |
| 444 | ], |
| 445 | 'default' => 1, |
| 446 | 'condition' => [ |
| 447 | 'eael_show_post_terms' => 'yes', |
| 448 | ], |
| 449 | ] |
| 450 | ); |
| 451 | |
| 452 | $this->add_control( |
| 453 | 'eael_product_button_appearance', |
| 454 | [ |
| 455 | 'label' => __('Button Appears', 'essential-addons-for-elementor-lite'), |
| 456 | 'type' => Controls_Manager::SELECT, |
| 457 | 'default' => 'hover', |
| 458 | 'separator' => 'before', |
| 459 | 'options' => [ |
| 460 | 'hover' => __('On Hover', 'essential-addons-for-elementor-lite'), |
| 461 | 'static' => __('Static', 'essential-addons-for-elementor-lite'), |
| 462 | 'hide' => __('No Buttons', 'essential-addons-for-elementor-lite'), |
| 463 | ], |
| 464 | ] |
| 465 | ); |
| 466 | $this->add_control( |
| 467 | 'eael_product_button_appearance_note_for_preset_4', |
| 468 | [ |
| 469 | 'label' => '', |
| 470 | 'type' => \Elementor\Controls_Manager::RAW_HTML, |
| 471 | 'raw' => esc_html__( 'Static option will not work for Preset 4.', 'essential-addons-for-elementor-lite' ), |
| 472 | 'content_classes' => 'eael-warning', |
| 473 | 'condition' => [ |
| 474 | 'eael_dynamic_template_layout' => 'preset-4', |
| 475 | 'eael_product_button_appearance' => 'static', |
| 476 | ], |
| 477 | ] |
| 478 | ); |
| 479 | |
| 480 | $this->add_control( |
| 481 | 'eael_product_carousel_quick_view', |
| 482 | [ |
| 483 | 'label' => esc_html__( 'Show Quick View?', 'essential-addons-for-elementor-lite' ), |
| 484 | 'type' => Controls_Manager::SWITCHER, |
| 485 | 'return_value' => 'yes', |
| 486 | 'default' => 'yes', |
| 487 | ] |
| 488 | ); |
| 489 | |
| 490 | $this->add_control( |
| 491 | 'eael_product_quick_view_title_tag', |
| 492 | [ |
| 493 | 'label' => __('Quick View Title Tag', 'essential-addons-for-elementor-lite'), |
| 494 | 'type' => Controls_Manager::SELECT, |
| 495 | 'default' => 'h1', |
| 496 | 'options' => [ |
| 497 | 'h1' => __('H1', 'essential-addons-for-elementor-lite'), |
| 498 | 'h2' => __('H2', 'essential-addons-for-elementor-lite'), |
| 499 | 'h3' => __('H3', 'essential-addons-for-elementor-lite'), |
| 500 | 'h4' => __('H4', 'essential-addons-for-elementor-lite'), |
| 501 | 'h5' => __('H5', 'essential-addons-for-elementor-lite'), |
| 502 | 'h6' => __('H6', 'essential-addons-for-elementor-lite'), |
| 503 | 'span' => __('Span', 'essential-addons-for-elementor-lite'), |
| 504 | 'p' => __('P', 'essential-addons-for-elementor-lite'), |
| 505 | 'div' => __('Div', 'essential-addons-for-elementor-lite'), |
| 506 | ], |
| 507 | 'condition' => [ |
| 508 | 'eael_product_carousel_quick_view' => 'yes', |
| 509 | ], |
| 510 | ] |
| 511 | ); |
| 512 | |
| 513 | $this->add_control( |
| 514 | 'eael_product_carousel_image_clickable', |
| 515 | [ |
| 516 | 'label' => esc_html__('Image Clickable?', 'essential-addons-for-elementor-lite'), |
| 517 | 'type' => Controls_Manager::SWITCHER, |
| 518 | 'return_value' => 'yes', |
| 519 | 'default' => 'no', |
| 520 | 'separator' => 'before', |
| 521 | ] |
| 522 | ); |
| 523 | |
| 524 | |
| 525 | $this->add_control( |
| 526 | 'eael_product_carousel_title_clickable', |
| 527 | [ |
| 528 | 'label' => esc_html__('Title Clickable?', 'essential-addons-for-elementor-lite'), |
| 529 | 'type' => Controls_Manager::SWITCHER, |
| 530 | 'return_value' => 'yes', |
| 531 | 'default' => 'no', |
| 532 | ] |
| 533 | ); |
| 534 | |
| 535 | $this->add_control( |
| 536 | 'eael_product_carousel_not_found_msg', |
| 537 | [ |
| 538 | 'label' => __( 'Not Found Message', 'essential-addons-for-elementor-lite' ), |
| 539 | 'type' => Controls_Manager::TEXT, |
| 540 | 'default' => __( 'Products Not Found', 'essential-addons-for-elementor-lite' ), |
| 541 | 'separator' => 'before', |
| 542 | 'ai' => [ |
| 543 | 'active' => false, |
| 544 | ], |
| 545 | ] |
| 546 | ); |
| 547 | |
| 548 | $this->end_controls_section(); |
| 549 | } |
| 550 | |
| 551 | protected function eael_woo_product_carousel_options() { |
| 552 | |
| 553 | $this->start_controls_section( |
| 554 | 'section_additional_options', |
| 555 | [ |
| 556 | 'label' => __( 'Carousel Settings', 'essential-addons-for-elementor-lite' ), |
| 557 | ] |
| 558 | ); |
| 559 | |
| 560 | $this->add_control( |
| 561 | 'carousel_effect', |
| 562 | [ |
| 563 | 'label' => __('Effect', 'essential-addons-for-elementor-lite'), |
| 564 | 'description' => __('Sets transition effect', 'essential-addons-for-elementor-lite'), |
| 565 | 'type' => Controls_Manager::SELECT, |
| 566 | 'default' => 'slide', |
| 567 | 'options' => [ |
| 568 | 'slide' => __('Slide', 'essential-addons-for-elementor-lite'), |
| 569 | 'coverflow' => __('Coverflow', 'essential-addons-for-elementor-lite'), |
| 570 | ], |
| 571 | ] |
| 572 | ); |
| 573 | |
| 574 | $this->add_responsive_control( |
| 575 | 'items', |
| 576 | [ |
| 577 | 'label' => __( 'Visible Product', 'essential-addons-for-elementor-lite' ), |
| 578 | 'type' => Controls_Manager::SELECT, |
| 579 | 'options' => [ |
| 580 | '1' => __( '1', 'essential-addons-for-elementor-lite' ), |
| 581 | '2' => __( '2', 'essential-addons-for-elementor-lite' ), |
| 582 | '3' => __( '3', 'essential-addons-for-elementor-lite' ), |
| 583 | '4' => __( '4', 'essential-addons-for-elementor-lite' ), |
| 584 | '5' => __( '5', 'essential-addons-for-elementor-lite' ), |
| 585 | '6' => __( '6', 'essential-addons-for-elementor-lite' ), |
| 586 | ], |
| 587 | 'default' => 3, |
| 588 | 'tablet_default' => 2, |
| 589 | 'mobile_default' => 1, |
| 590 | 'condition' => [ |
| 591 | 'carousel_effect' => 'slide', |
| 592 | ] |
| 593 | ] |
| 594 | ); |
| 595 | |
| 596 | $this->add_responsive_control( |
| 597 | 'slide_items', |
| 598 | [ |
| 599 | 'label' => __( 'Slide to Scroll', 'essential-addons-for-elementor-lite' ), |
| 600 | 'type' => Controls_Manager::SELECT, |
| 601 | 'options' => [ |
| 602 | '1' => __( '1', 'essential-addons-for-elementor-lite' ), |
| 603 | '2' => __( '2', 'essential-addons-for-elementor-lite' ), |
| 604 | '3' => __( '3', 'essential-addons-for-elementor-lite' ), |
| 605 | '4' => __( '4', 'essential-addons-for-elementor-lite' ), |
| 606 | '5' => __( '5', 'essential-addons-for-elementor-lite' ), |
| 607 | '6' => __( '6', 'essential-addons-for-elementor-lite' ), |
| 608 | ], |
| 609 | 'default' => 1, |
| 610 | 'condition' => [ |
| 611 | 'carousel_effect' => 'slide', |
| 612 | 'enable_marquee!' => 'yes', |
| 613 | ] |
| 614 | ] |
| 615 | ); |
| 616 | |
| 617 | $this->add_control( |
| 618 | 'carousel_rotate', |
| 619 | [ |
| 620 | 'label' => __( 'Rotate', 'essential-addons-for-elementor-lite' ), |
| 621 | 'type' => Controls_Manager::SLIDER, |
| 622 | 'default' => ['size' => 50], |
| 623 | 'range' => [ |
| 624 | 'px' => [ |
| 625 | 'min' => 0, |
| 626 | 'max' => 100, |
| 627 | 'step' => 1, |
| 628 | ], |
| 629 | ], |
| 630 | 'condition' => [ |
| 631 | 'carousel_effect' => 'coverflow', |
| 632 | ] |
| 633 | ] |
| 634 | ); |
| 635 | $this->add_control( |
| 636 | 'carousel_depth', |
| 637 | [ |
| 638 | 'label' => __( 'Depth', 'essential-addons-for-elementor-lite' ), |
| 639 | 'type' => Controls_Manager::SLIDER, |
| 640 | 'default' => ['size' => 100], |
| 641 | 'range' => [ |
| 642 | 'px' => [ |
| 643 | 'min' => 100, |
| 644 | 'max' => 1000, |
| 645 | 'step' => 10, |
| 646 | ], |
| 647 | ], |
| 648 | 'condition' => [ |
| 649 | 'carousel_effect' => 'coverflow', |
| 650 | ] |
| 651 | ] |
| 652 | ); |
| 653 | $this->add_control( |
| 654 | 'carousel_stretch', |
| 655 | [ |
| 656 | 'label' => __( 'Stretch', 'essential-addons-for-elementor-lite' ), |
| 657 | 'type' => Controls_Manager::SLIDER, |
| 658 | 'default' => ['size' => 10], |
| 659 | 'range' => [ |
| 660 | 'px' => [ |
| 661 | 'min' => 0, |
| 662 | 'max' => 200, |
| 663 | 'step' => 10, |
| 664 | ], |
| 665 | ], |
| 666 | 'condition' => [ |
| 667 | 'carousel_effect' => 'coverflow', |
| 668 | ] |
| 669 | ] |
| 670 | ); |
| 671 | |
| 672 | $this->add_responsive_control( |
| 673 | 'margin', |
| 674 | [ |
| 675 | 'label' => __('Items Gap', 'essential-addons-for-elementor-lite'), |
| 676 | 'type' => Controls_Manager::SLIDER, |
| 677 | 'default' => ['size' => 10], |
| 678 | 'range' => [ |
| 679 | 'px' => [ |
| 680 | 'min' => 0, |
| 681 | 'max' => 100, |
| 682 | 'step' => 1, |
| 683 | ], |
| 684 | ], |
| 685 | 'size_units' => '', |
| 686 | ] |
| 687 | ); |
| 688 | |
| 689 | $this->add_control( |
| 690 | 'slider_speed', |
| 691 | [ |
| 692 | 'label' => __( 'Speed', 'essential-addons-for-elementor-lite' ), |
| 693 | 'description' => __( 'Duration of transition between slides (in ms)', |
| 694 | 'essential-addons-for-elementor-lite' ), |
| 695 | 'type' => Controls_Manager::SLIDER, |
| 696 | 'default' => ['size' => 400], |
| 697 | 'range' => [ |
| 698 | 'px' => [ |
| 699 | 'min' => 100, |
| 700 | 'max' => 10000, |
| 701 | 'step' => 1, |
| 702 | ], |
| 703 | ], |
| 704 | 'size_units' => '', |
| 705 | ] |
| 706 | ); |
| 707 | |
| 708 | $this->add_control( |
| 709 | 'autoplay', |
| 710 | [ |
| 711 | 'label' => __( 'Autoplay', 'essential-addons-for-elementor-lite' ), |
| 712 | 'type' => Controls_Manager::SWITCHER, |
| 713 | 'default' => 'yes', |
| 714 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 715 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 716 | 'return_value' => 'yes', |
| 717 | ] |
| 718 | ); |
| 719 | |
| 720 | $this->add_control( |
| 721 | 'enable_marquee', |
| 722 | [ |
| 723 | 'label' => __( 'Enable Marquee', 'essential-addons-for-elementor-lite' ), |
| 724 | 'type' => Controls_Manager::SWITCHER, |
| 725 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 726 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 727 | 'default' => 'no', |
| 728 | 'return_value' => 'yes', |
| 729 | 'condition' => [ |
| 730 | 'autoplay' => 'yes', |
| 731 | 'carousel_effect' => [ 'slide', 'coverflow' ], |
| 732 | ], |
| 733 | ] |
| 734 | ); |
| 735 | |
| 736 | $this->add_control( |
| 737 | 'autoplay_speed', |
| 738 | [ |
| 739 | 'label' => __( 'Autoplay Speed', 'essential-addons-for-elementor-lite' ), |
| 740 | 'type' => Controls_Manager::SLIDER, |
| 741 | 'default' => ['size' => 2000], |
| 742 | 'range' => [ |
| 743 | 'px' => [ |
| 744 | 'min' => 500, |
| 745 | 'max' => 5000, |
| 746 | 'step' => 1, |
| 747 | ], |
| 748 | ], |
| 749 | 'size_units' => '', |
| 750 | 'condition' => [ |
| 751 | 'autoplay' => 'yes', |
| 752 | 'enable_marquee!' => 'yes', |
| 753 | ], |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->add_control( |
| 758 | 'pause_on_hover', |
| 759 | [ |
| 760 | 'label' => __( 'Pause On Hover', 'essential-addons-for-elementor-lite' ), |
| 761 | 'type' => Controls_Manager::SWITCHER, |
| 762 | 'default' => '', |
| 763 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 764 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 765 | 'return_value' => 'yes', |
| 766 | 'condition' => [ |
| 767 | 'autoplay' => 'yes', |
| 768 | 'enable_marquee!' => 'yes', |
| 769 | ], |
| 770 | ] |
| 771 | ); |
| 772 | |
| 773 | $this->add_control( |
| 774 | 'infinite_loop', |
| 775 | [ |
| 776 | 'label' => __( 'Infinite Loop', 'essential-addons-for-elementor-lite' ), |
| 777 | 'type' => Controls_Manager::SWITCHER, |
| 778 | 'default' => 'yes', |
| 779 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 780 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 781 | 'return_value' => 'yes', |
| 782 | ] |
| 783 | ); |
| 784 | |
| 785 | $this->add_control( |
| 786 | 'grab_cursor', |
| 787 | [ |
| 788 | 'label' => __( 'Grab Cursor', 'essential-addons-for-elementor-lite' ), |
| 789 | 'description' => __( 'Shows grab cursor when you hover over the slider', |
| 790 | 'essential-addons-for-elementor-lite' ), |
| 791 | 'type' => Controls_Manager::SWITCHER, |
| 792 | 'default' => '', |
| 793 | 'label_on' => __( 'Show', 'essential-addons-for-elementor-lite' ), |
| 794 | 'label_off' => __( 'Hide', 'essential-addons-for-elementor-lite' ), |
| 795 | 'return_value' => 'yes', |
| 796 | ] |
| 797 | ); |
| 798 | |
| 799 | $this->add_control( |
| 800 | 'navigation_heading', |
| 801 | [ |
| 802 | 'label' => __( 'Navigation', 'essential-addons-for-elementor-lite' ), |
| 803 | 'type' => Controls_Manager::HEADING, |
| 804 | 'separator' => 'before', |
| 805 | ] |
| 806 | ); |
| 807 | |
| 808 | $this->add_control( |
| 809 | 'eael_marquee_warning_text', |
| 810 | [ |
| 811 | 'type' => Controls_Manager::RAW_HTML, |
| 812 | 'raw' => __( 'Arrows & Dots are not available on <strong>Marquee</stong> Mode.', 'essential-addons-for-elementor-lite' ), |
| 813 | 'content_classes' => 'eael-warning', |
| 814 | 'condition' => [ |
| 815 | 'autoplay' => 'yes', |
| 816 | 'enable_marquee' => 'yes', |
| 817 | 'carousel_effect' => [ 'slide', 'coverflow' ], |
| 818 | ], |
| 819 | ] |
| 820 | ); |
| 821 | |
| 822 | $this->add_control( |
| 823 | 'arrows', |
| 824 | [ |
| 825 | 'label' => __( 'Arrows', 'essential-addons-for-elementor-lite' ), |
| 826 | 'type' => Controls_Manager::SWITCHER, |
| 827 | 'default' => 'no', |
| 828 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 829 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 830 | 'return_value' => 'yes', |
| 831 | ] |
| 832 | ); |
| 833 | |
| 834 | $this->add_control( |
| 835 | 'dots', |
| 836 | [ |
| 837 | 'label' => __( 'Dots', 'essential-addons-for-elementor-lite' ), |
| 838 | 'type' => Controls_Manager::SWITCHER, |
| 839 | 'default' => 'yes', |
| 840 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 841 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 842 | 'return_value' => 'yes', |
| 843 | ] |
| 844 | ); |
| 845 | |
| 846 | $this->add_control( |
| 847 | 'image_dots', |
| 848 | [ |
| 849 | 'label' => __('Image Dots', 'essential-addons-for-elementor-lite'), |
| 850 | 'type' => Controls_Manager::SWITCHER, |
| 851 | 'label_on' => __('Yes', 'essential-addons-for-elementor-lite'), |
| 852 | 'label_off' => __('No', 'essential-addons-for-elementor-lite'), |
| 853 | 'return_value' => 'yes', |
| 854 | 'condition' => [ |
| 855 | 'dots' => 'yes', |
| 856 | ] |
| 857 | ] |
| 858 | ); |
| 859 | |
| 860 | |
| 861 | $this->add_responsive_control( |
| 862 | 'image_dots_visibility', |
| 863 | [ |
| 864 | 'label' => __('Image Dots Visibility', 'essential-addons-for-elementor-lite'), |
| 865 | 'type' => Controls_Manager::SWITCHER, |
| 866 | 'label_on' => __('Show', 'essential-addons-for-elementor-lite'), |
| 867 | 'label_off' => __('Hide', 'essential-addons-for-elementor-lite'), |
| 868 | 'return_value' => 'yes', |
| 869 | 'default' => 'yes', |
| 870 | 'condition' => [ |
| 871 | 'dots' => 'yes', |
| 872 | 'image_dots' => 'yes', |
| 873 | ] |
| 874 | ] |
| 875 | ); |
| 876 | |
| 877 | $this->add_control( |
| 878 | 'direction', |
| 879 | [ |
| 880 | 'label' => __( 'Direction', 'essential-addons-for-elementor-lite' ), |
| 881 | 'type' => Controls_Manager::SELECT, |
| 882 | 'default' => 'left', |
| 883 | 'options' => [ |
| 884 | 'left' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 885 | 'right' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 886 | ], |
| 887 | 'separator' => 'before', |
| 888 | ] |
| 889 | ); |
| 890 | |
| 891 | |
| 892 | |
| 893 | $this->end_controls_section(); |
| 894 | } |
| 895 | |
| 896 | protected function eael_woo_product_carousel_query() { |
| 897 | $this->start_controls_section( 'eael_section_product_carousel_query', [ |
| 898 | 'label' => esc_html__( 'Query', 'essential-addons-for-elementor-lite' ), |
| 899 | ] ); |
| 900 | |
| 901 | $this->add_control( 'eael_product_carousel_product_filter', [ |
| 902 | 'label' => esc_html__( 'Filter By', 'essential-addons-for-elementor-lite' ), |
| 903 | 'type' => Controls_Manager::SELECT, |
| 904 | 'default' => 'recent-products', |
| 905 | 'options' => $this->eael_get_product_filterby_options(), |
| 906 | ] ); |
| 907 | |
| 908 | $this->add_control( |
| 909 | 'eael_global_related_products_warning_text', |
| 910 | [ |
| 911 | 'type' => Controls_Manager::RAW_HTML, |
| 912 | 'raw' => __( 'This filter will only affect in <strong>Single Product</strong> page of <strong>Elementor Theme Builder</strong> dynamically.', 'essential-addons-for-elementor-lite' ), |
| 913 | 'content_classes' => 'eael-warning', |
| 914 | 'condition' => [ |
| 915 | 'eael_product_carousel_product_filter' => 'related-products', |
| 916 | ], |
| 917 | ] |
| 918 | ); |
| 919 | |
| 920 | $this->add_control( 'orderby', [ |
| 921 | 'label' => __( 'Order By', 'essential-addons-for-elementor-lite' ), |
| 922 | 'type' => Controls_Manager::SELECT, |
| 923 | 'options' => $this->eael_get_product_orderby_options(), |
| 924 | 'default' => 'date', |
| 925 | |
| 926 | ] ); |
| 927 | |
| 928 | $this->add_control( 'order', [ |
| 929 | 'label' => __( 'Order', 'essential-addons-for-elementor-lite' ), |
| 930 | 'type' => Controls_Manager::SELECT, |
| 931 | 'options' => [ |
| 932 | 'asc' => 'Ascending', |
| 933 | 'desc' => 'Descending', |
| 934 | ], |
| 935 | 'default' => 'desc', |
| 936 | |
| 937 | ] ); |
| 938 | |
| 939 | $this->add_control( 'eael_product_carousel_products_count', [ |
| 940 | 'label' => __( 'Products Count', 'essential-addons-for-elementor-lite' ), |
| 941 | 'type' => Controls_Manager::NUMBER, |
| 942 | 'default' => 4, |
| 943 | 'min' => 1, |
| 944 | 'max' => 1000, |
| 945 | 'step' => 1, |
| 946 | ] ); |
| 947 | |
| 948 | $this->add_control( 'product_offset', [ |
| 949 | 'label' => __( 'Offset', 'essential-addons-for-elementor-lite' ), |
| 950 | 'type' => Controls_Manager::NUMBER, |
| 951 | 'default' => 0, |
| 952 | 'condition' => [ |
| 953 | 'eael_product_carousel_product_filter!' => 'manual', |
| 954 | ], |
| 955 | ] ); |
| 956 | |
| 957 | $this->add_control( |
| 958 | 'eael_product_carousel_products_in', |
| 959 | [ |
| 960 | 'label' => esc_html__('Select Products', 'essential-addons-for-elementor-lite'), |
| 961 | 'type' => 'eael-select2', |
| 962 | 'label_block' => true, |
| 963 | 'multiple' => true, |
| 964 | 'source_type' => 'product', |
| 965 | 'condition' => [ |
| 966 | 'eael_product_carousel_product_filter' => 'manual' |
| 967 | ], |
| 968 | ]); |
| 969 | |
| 970 | $this->add_control( |
| 971 | 'eael_product_carousel_products_status', |
| 972 | [ |
| 973 | 'label' => __( 'Product Status', 'essential-addons-for-elementor-lite' ), |
| 974 | 'type' => Controls_Manager::SELECT2, |
| 975 | 'label_block' => true, |
| 976 | 'multiple' => true, |
| 977 | 'default' => [ 'publish', 'pending', 'future' ], |
| 978 | 'options' => $this->eael_get_product_statuses(), |
| 979 | 'condition' => [ |
| 980 | 'eael_product_carousel_product_filter!' => 'manual', |
| 981 | ], |
| 982 | ] |
| 983 | ); |
| 984 | |
| 985 | $this->add_control( |
| 986 | 'product_type_logged_users', |
| 987 | [ |
| 988 | 'label' => __('Purchase Type', 'essential-addons-for-elementor-lite'), |
| 989 | 'type' => Controls_Manager::SELECT, |
| 990 | 'description' => __('For logged in users only!', 'essential-addons-for-elementor-lite'), |
| 991 | 'options' => [ |
| 992 | 'both' => __('Both', 'essential-addons-for-elementor-lite'), |
| 993 | 'purchased' => __('Purchased Only', 'essential-addons-for-elementor-lite'), |
| 994 | 'not-purchased' => __('Not Purchased Only', 'essential-addons-for-elementor-lite'), |
| 995 | ], |
| 996 | 'default' => 'both', |
| 997 | ] |
| 998 | ); |
| 999 | |
| 1000 | $taxonomies = get_taxonomies(['object_type' => ['product']], 'objects'); |
| 1001 | foreach ($taxonomies as $taxonomy => $object) { |
| 1002 | if (!isset($object->object_type[0])) { |
| 1003 | continue; |
| 1004 | } |
| 1005 | |
| 1006 | $this->add_control( |
| 1007 | $taxonomy . '_ids', |
| 1008 | [ |
| 1009 | 'label' => $object->label, |
| 1010 | 'type' => Controls_Manager::SELECT2, |
| 1011 | 'label_block' => true, |
| 1012 | 'multiple' => true, |
| 1013 | 'object_type' => $taxonomy, |
| 1014 | 'options' => wp_list_pluck(get_terms($taxonomy), 'name', 'term_id'), |
| 1015 | 'condition' => [ |
| 1016 | 'eael_product_carousel_product_filter!' => 'related-products', |
| 1017 | 'eael_product_carousel_product_filter!' => 'manual', |
| 1018 | ], |
| 1019 | ] |
| 1020 | ); |
| 1021 | } |
| 1022 | |
| 1023 | $this->end_controls_section(); |
| 1024 | } |
| 1025 | |
| 1026 | protected function eael_product_action_buttons() { |
| 1027 | |
| 1028 | } |
| 1029 | |
| 1030 | protected function eael_product_badges() { |
| 1031 | $this->start_controls_section( |
| 1032 | 'eael_section_product_badges', |
| 1033 | [ |
| 1034 | 'label' => esc_html__( 'Sale / Stock Out Badge', 'essential-addons-for-elementor-lite' ), |
| 1035 | |
| 1036 | ] |
| 1037 | ); |
| 1038 | $this->add_control( |
| 1039 | 'eael_product_sale_badge_preset', |
| 1040 | [ |
| 1041 | 'label' => esc_html__( 'Style Preset', 'essential-addons-for-elementor-lite' ), |
| 1042 | 'type' => Controls_Manager::SELECT, |
| 1043 | 'default' => 'sale-preset-5', |
| 1044 | 'options' => [ |
| 1045 | 'sale-preset-5' => esc_html__( 'Preset 1', 'essential-addons-for-elementor-lite' ), |
| 1046 | 'sale-preset-2' => esc_html__( 'Preset 2', 'essential-addons-for-elementor-lite' ), |
| 1047 | 'sale-preset-3' => esc_html__( 'Preset 3', 'essential-addons-for-elementor-lite' ), |
| 1048 | 'sale-preset-4' => esc_html__( 'Preset 4', 'essential-addons-for-elementor-lite' ), |
| 1049 | 'sale-preset-1' => esc_html__( 'Preset 5', 'essential-addons-for-elementor-lite' ), |
| 1050 | |
| 1051 | ] |
| 1052 | ] |
| 1053 | ); |
| 1054 | |
| 1055 | $this->add_control( |
| 1056 | 'eael_product_sale_badge_alignment', |
| 1057 | [ |
| 1058 | 'label' => __( 'Alignment', 'essential-addons-for-elementor-lite' ), |
| 1059 | 'type' => Controls_Manager::CHOOSE, |
| 1060 | 'options' => [ |
| 1061 | 'left' => [ |
| 1062 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 1063 | 'icon' => 'eicon-text-align-left', |
| 1064 | ], |
| 1065 | 'right' => [ |
| 1066 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 1067 | 'icon' => 'eicon-text-align-right', |
| 1068 | ], |
| 1069 | ], |
| 1070 | 'condition' => [ |
| 1071 | 'eael_dynamic_template_layout!' => 'preset-2', |
| 1072 | ] |
| 1073 | ] |
| 1074 | ); |
| 1075 | |
| 1076 | $this->add_control( |
| 1077 | 'eael_product_carousel_sale_text', |
| 1078 | [ |
| 1079 | 'label' => esc_html__( 'Sale Text', 'essential-addons-for-elementor-lite' ), |
| 1080 | 'type' => Controls_Manager::TEXT, |
| 1081 | 'separator' => 'before', |
| 1082 | 'ai' => [ |
| 1083 | 'active' => false, |
| 1084 | ], |
| 1085 | ] |
| 1086 | ); |
| 1087 | $this->add_control( |
| 1088 | 'eael_product_carousel_stockout_text', |
| 1089 | [ |
| 1090 | 'label' => esc_html__( 'Stock Out Text', 'essential-addons-for-elementor-lite' ), |
| 1091 | 'type' => Controls_Manager::TEXT, |
| 1092 | 'ai' => [ |
| 1093 | 'active' => false, |
| 1094 | ], |
| 1095 | ] |
| 1096 | ); |
| 1097 | |
| 1098 | $this->end_controls_section(); |
| 1099 | } |
| 1100 | |
| 1101 | protected function init_style_product_controls() { |
| 1102 | $this->start_controls_section( |
| 1103 | 'eael_product_carousel_styles', |
| 1104 | [ |
| 1105 | 'label' => esc_html__( 'Products', 'essential-addons-for-elementor-lite' ), |
| 1106 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1107 | ] |
| 1108 | ); |
| 1109 | |
| 1110 | $this->add_responsive_control( |
| 1111 | 'eael_product_carousel_alignment', |
| 1112 | [ |
| 1113 | 'label' => __( 'Alignment', 'essential-addons-for-elementor-lite' ), |
| 1114 | 'type' => \Elementor\Controls_Manager::CHOOSE, |
| 1115 | 'options' => [ |
| 1116 | 'left' => [ |
| 1117 | 'title' => __( 'Left', 'essential-addons-for-elementor-lite' ), |
| 1118 | 'icon' => 'eicon-text-align-left', |
| 1119 | ], |
| 1120 | 'center' => [ |
| 1121 | 'title' => __( 'Center', 'essential-addons-for-elementor-lite' ), |
| 1122 | 'icon' => 'eicon-text-align-center', |
| 1123 | ], |
| 1124 | 'right' => [ |
| 1125 | 'title' => __( 'Right', 'essential-addons-for-elementor-lite' ), |
| 1126 | 'icon' => 'eicon-text-align-right', |
| 1127 | ], |
| 1128 | ], |
| 1129 | 'default' => 'center', |
| 1130 | 'toggle' => true, |
| 1131 | 'selectors' => [ |
| 1132 | '{{WRAPPER}} .eael-product-carousel .product-details-wrap' => 'text-align: {{VALUE}};', |
| 1133 | '{{WRAPPER}} .eael-product-carousel .product-details-wrap .eael-star-rating' => 'justify-content: {{VALUE}};', |
| 1134 | ], |
| 1135 | 'condition' => [ |
| 1136 | 'eael_dynamic_template_layout' => 'preset-3', |
| 1137 | ] |
| 1138 | ] |
| 1139 | ); |
| 1140 | |
| 1141 | $this->add_control( |
| 1142 | 'eael_product_carousel_background_color', |
| 1143 | [ |
| 1144 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 1145 | 'type' => Controls_Manager::COLOR, |
| 1146 | 'selectors' => [ |
| 1147 | '{{WRAPPER}} .eael-woo-product-carousel-container .eael-product-carousel' => 'background-color: {{VALUE}};', |
| 1148 | ], |
| 1149 | 'condition' => [ |
| 1150 | 'eael_dynamic_template_layout!' => ['preset-2','preset-4'], |
| 1151 | ] |
| 1152 | ] |
| 1153 | ); |
| 1154 | |
| 1155 | $this->add_control( |
| 1156 | 'eael_product_carousel_overlay_color', |
| 1157 | [ |
| 1158 | 'label' => esc_html__( 'Overlay Color', 'essential-addons-for-elementor-lite' ), |
| 1159 | 'type' => Controls_Manager::COLOR, |
| 1160 | 'description' => __( 'Use opacity color for overlay design.', 'essential-addons-for-elementor-lite' ), |
| 1161 | 'selectors' => [ |
| 1162 | '{{WRAPPER}} .eael-woo-product-carousel-container .eael-product-carousel .carousel-overlay' => 'background: {{VALUE}};', |
| 1163 | ], |
| 1164 | 'condition' => [ |
| 1165 | 'eael_dynamic_template_layout' => ['preset-2','preset-4'], |
| 1166 | ] |
| 1167 | ] |
| 1168 | ); |
| 1169 | |
| 1170 | $this->add_responsive_control( |
| 1171 | 'eael_product_carousel_margin', |
| 1172 | [ |
| 1173 | 'label' => __( 'Margin', 'essential-addons-for-elementor-lite' ), |
| 1174 | 'type' => Controls_Manager::DIMENSIONS, |
| 1175 | 'size_units' => ['px', '%', 'em'], |
| 1176 | 'selectors' => [ |
| 1177 | '{{WRAPPER}} .eael-product-carousel' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1178 | ], |
| 1179 | ] |
| 1180 | ); |
| 1181 | |
| 1182 | $this->start_controls_tabs( 'eael_product_carousel_tabs' ); |
| 1183 | |
| 1184 | $this->start_controls_tab( 'eael_product_carousel_tabs_normal', |
| 1185 | ['label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite' )] ); |
| 1186 | |
| 1187 | $this->add_group_control( |
| 1188 | Group_Control_Border::get_type(), |
| 1189 | [ |
| 1190 | 'name' => 'eael_product_carousel_border', |
| 1191 | 'fields_options' => [ |
| 1192 | 'border' => [ |
| 1193 | 'default' => 'solid', |
| 1194 | ], |
| 1195 | 'width' => [ |
| 1196 | 'default' => [ |
| 1197 | 'top' => '1', |
| 1198 | 'right' => '1', |
| 1199 | 'bottom' => '1', |
| 1200 | 'left' => '1', |
| 1201 | 'isLinked' => false, |
| 1202 | ], |
| 1203 | ], |
| 1204 | 'color' => [ |
| 1205 | 'default' => '#eee', |
| 1206 | ], |
| 1207 | ], |
| 1208 | 'selector' => '{{WRAPPER}} .eael-product-carousel', |
| 1209 | ] |
| 1210 | ); |
| 1211 | |
| 1212 | $this->add_group_control( |
| 1213 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 1214 | [ |
| 1215 | 'name' => 'eael_product_carousel_shadow', |
| 1216 | 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 1217 | 'selector' => '{{WRAPPER}} .eael-product-carousel', |
| 1218 | ] |
| 1219 | ); |
| 1220 | |
| 1221 | |
| 1222 | $this->end_controls_tab(); |
| 1223 | |
| 1224 | $this->start_controls_tab( 'eael_product_carousel_hover_styles', |
| 1225 | ['label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite' )] ); |
| 1226 | |
| 1227 | $this->add_control( |
| 1228 | 'eael_product_carousel_hover_border_color', |
| 1229 | [ |
| 1230 | 'label' => esc_html__( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 1231 | 'type' => Controls_Manager::COLOR, |
| 1232 | 'default' => '', |
| 1233 | 'selectors' => [ |
| 1234 | '{{WRAPPER}} .eael-product-carousel:hover' => 'border-color: {{VALUE}};', |
| 1235 | ], |
| 1236 | 'condition' => [ |
| 1237 | 'eael_product_carousel_border_border!' => '', |
| 1238 | ], |
| 1239 | ] |
| 1240 | ); |
| 1241 | $this->add_group_control( |
| 1242 | Group_Control_Box_Shadow::get_type(), |
| 1243 | [ |
| 1244 | 'name' => 'eael_product_carousel_box_shadow_hover', |
| 1245 | 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 1246 | 'selector' => '{{WRAPPER}} .eael-product-carousel:hover', |
| 1247 | ] |
| 1248 | ); |
| 1249 | |
| 1250 | $this->end_controls_tab(); |
| 1251 | |
| 1252 | $this->end_controls_tabs(); |
| 1253 | |
| 1254 | $this->add_control( |
| 1255 | 'eael_product_carousel_border_radius', |
| 1256 | [ |
| 1257 | 'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 1258 | 'type' => Controls_Manager::DIMENSIONS, |
| 1259 | 'selectors' => [ |
| 1260 | '{{WRAPPER}} .eael-product-carousel' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 1261 | '{{WRAPPER}} .eael-product-carousel .image-wrap img, {{WRAPPER}} .eael-product-carousel > .product-image-wrap' |
| 1262 | => 'border-radius: {{TOP}}px {{RIGHT}}px 0 0;', |
| 1263 | '{{WRAPPER}} .eael-product-carousel.product-details-none .image-wrap img, {{WRAPPER}} .eael-product-carousel > .product-image-wrap' |
| 1264 | => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 1265 | '{{WRAPPER}} .eael-product-carousel.product-details-none-overlay .image-wrap img, {{WRAPPER}} .eael-product-carousel > .product-image-wrap' |
| 1266 | => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;', |
| 1267 | ], |
| 1268 | ] |
| 1269 | ); |
| 1270 | |
| 1271 | $this->add_control( |
| 1272 | 'eael_product_carousel_details_heading', |
| 1273 | [ |
| 1274 | 'label' => __( 'Product Details', 'essential-addons-for-elementor-lite' ), |
| 1275 | 'type' => Controls_Manager::HEADING, |
| 1276 | 'separator' => 'before', |
| 1277 | ] |
| 1278 | ); |
| 1279 | |
| 1280 | $this->add_responsive_control( |
| 1281 | 'eael_product_carousel_inner_padding', |
| 1282 | [ |
| 1283 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 1284 | 'type' => Controls_Manager::DIMENSIONS, |
| 1285 | 'size_units' => ['px', '%'], |
| 1286 | 'range' => [ |
| 1287 | 'px' => [ |
| 1288 | 'min' => 0, |
| 1289 | 'max' => 100, |
| 1290 | 'step' => 1, |
| 1291 | ], |
| 1292 | '%' => [ |
| 1293 | 'min' => 0, |
| 1294 | 'max' => 100, |
| 1295 | ], |
| 1296 | ], |
| 1297 | 'default' => [ |
| 1298 | 'top' => '15', |
| 1299 | 'right' => '15', |
| 1300 | 'bottom' => '15', |
| 1301 | 'left' => '15', |
| 1302 | 'unit' => 'px', |
| 1303 | 'isLinked' => true, |
| 1304 | ], |
| 1305 | 'selectors' => [ |
| 1306 | '{{WRAPPER}} .eael-product-carousel .product-details-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1307 | ], |
| 1308 | ] |
| 1309 | ); |
| 1310 | |
| 1311 | $this->end_controls_section(); |
| 1312 | } |
| 1313 | |
| 1314 | protected function style_color_typography() { |
| 1315 | |
| 1316 | $this->start_controls_section( |
| 1317 | 'eael_section_product_carousel_typography', |
| 1318 | [ |
| 1319 | 'label' => esc_html__( 'Color & Typography', 'essential-addons-for-elementor-lite' ), |
| 1320 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1321 | ] |
| 1322 | ); |
| 1323 | |
| 1324 | $this->add_control( |
| 1325 | 'eael_product_carousel_product_title_heading', |
| 1326 | [ |
| 1327 | 'label' => __( 'Product Title', 'essential-addons-for-elementor-lite' ), |
| 1328 | 'type' => Controls_Manager::HEADING, |
| 1329 | ] |
| 1330 | ); |
| 1331 | |
| 1332 | $this->add_control( |
| 1333 | 'eael_product_carousel_product_title_color', |
| 1334 | [ |
| 1335 | 'label' => esc_html__( 'Product Title Color', 'essential-addons-for-elementor-lite' ), |
| 1336 | 'type' => Controls_Manager::COLOR, |
| 1337 | 'default' => '', |
| 1338 | 'selectors' => [ |
| 1339 | '{{WRAPPER}} .eael-product-carousel .woocommerce-loop-product__title, {{WRAPPER}} .eael-product-carousel .eael-product-title *' => 'color: {{VALUE}};', |
| 1340 | ], |
| 1341 | ] |
| 1342 | ); |
| 1343 | |
| 1344 | $this->add_group_control( |
| 1345 | Group_Control_Typography::get_type(), |
| 1346 | [ |
| 1347 | 'name' => 'eael_product_carousel_title_typo', |
| 1348 | 'selector' => '{{WRAPPER}} .eael-product-carousel .woocommerce-loop-product__title, {{WRAPPER}} .eael-product-carousel .eael-product-title *', |
| 1349 | ] |
| 1350 | ); |
| 1351 | |
| 1352 | $this->add_control( |
| 1353 | 'eael_product_carousel_product_price_heading', |
| 1354 | [ |
| 1355 | 'label' => __( 'Product Price', 'essential-addons-for-elementor-lite' ), |
| 1356 | 'type' => Controls_Manager::HEADING, |
| 1357 | ] |
| 1358 | ); |
| 1359 | |
| 1360 | $this->add_control( |
| 1361 | 'eael_product_carousel_sale_price_color', |
| 1362 | [ |
| 1363 | 'label' => esc_html__( 'Regular Price Color', 'essential-addons-for-elementor-lite' ), |
| 1364 | 'type' => Controls_Manager::COLOR, |
| 1365 | 'default' => '#025492', |
| 1366 | 'selectors' => [ |
| 1367 | '{{WRAPPER}} .eael-product-carousel .eael-product-price del .amount, {{WRAPPER}} .eael-product-carousel .eael-product-price .amount bdi' => 'color: {{VALUE}};', |
| 1368 | ], |
| 1369 | ] |
| 1370 | ); |
| 1371 | |
| 1372 | $this->add_control( |
| 1373 | 'eael_product_carousel_price_color', |
| 1374 | [ |
| 1375 | 'label' => esc_html__( 'Sale Price Color', 'essential-addons-for-elementor-lite' ), |
| 1376 | 'type' => Controls_Manager::COLOR, |
| 1377 | 'default' => '', |
| 1378 | 'selectors' => [ |
| 1379 | '{{WRAPPER}} .eael-product-carousel .eael-product-price ins .amount bdi' => 'color: {{VALUE}};', |
| 1380 | ], |
| 1381 | ] |
| 1382 | ); |
| 1383 | |
| 1384 | $this->add_group_control( |
| 1385 | Group_Control_Typography::get_type(), |
| 1386 | [ |
| 1387 | 'name' => 'eael_product_carousel_product_price_typography', |
| 1388 | 'selector' => '{{WRAPPER}} .eael-product-carousel .eael-product-price', |
| 1389 | ] |
| 1390 | ); |
| 1391 | |
| 1392 | $this->add_control( |
| 1393 | 'eael_product_carousel_rating_heading', |
| 1394 | [ |
| 1395 | 'label' => __( 'Star Rating', 'essential-addons-for-elementor-lite' ), |
| 1396 | 'type' => Controls_Manager::HEADING, |
| 1397 | ] |
| 1398 | ); |
| 1399 | |
| 1400 | $this->add_control( |
| 1401 | 'eael_product_carousel_rating_color', |
| 1402 | [ |
| 1403 | 'label' => esc_html__( 'Rating Color', 'essential-addons-for-elementor-lite' ), |
| 1404 | 'type' => Controls_Manager::COLOR, |
| 1405 | 'default' => '#f2b01e', |
| 1406 | 'selectors' => [ |
| 1407 | '{{WRAPPER}} .eael-product-carousel .star-rating::before' => 'color: {{VALUE}};', |
| 1408 | '{{WRAPPER}} .eael-product-carousel .star-rating span::before' => 'color: {{VALUE}};', |
| 1409 | ], |
| 1410 | ] |
| 1411 | ); |
| 1412 | |
| 1413 | $this->add_responsive_control( |
| 1414 | 'eael_product_carousel_rating_size', |
| 1415 | [ |
| 1416 | 'label' => esc_html__( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 1417 | 'type' => Controls_Manager::SLIDER, |
| 1418 | 'range' => [ |
| 1419 | 'px' => [ |
| 1420 | 'max' => 50, |
| 1421 | ], |
| 1422 | ], |
| 1423 | 'default' => [ |
| 1424 | 'size' => 14, |
| 1425 | ], |
| 1426 | 'selectors' => [ |
| 1427 | '{{WRAPPER}} .eael-woo-product-carousel-container .woocommerce ul.products .product .star-rating' => 'font-size: {{SIZE}}px!important;', |
| 1428 | '{{WRAPPER}} .eael-woo-product-carousel-container .woocommerce ul.products .product .star-rating::before' => 'font-size: {{SIZE}}px!important;', |
| 1429 | '{{WRAPPER}} .eael-woo-product-carousel-container .woocommerce ul.products .product .star-rating span::before' => 'font-size: {{SIZE}}px!important;', |
| 1430 | ], |
| 1431 | |
| 1432 | ] |
| 1433 | ); |
| 1434 | |
| 1435 | $this->add_control( |
| 1436 | 'eael_product_carousel_rating_count_heading', |
| 1437 | [ |
| 1438 | 'label' => __( 'Rating Count', 'essential-addons-for-elementor-lite' ), |
| 1439 | 'type' => Controls_Manager::HEADING, |
| 1440 | 'separator' => 'before', |
| 1441 | 'condition' => [ |
| 1442 | 'eael_rating_count' => 'yes' |
| 1443 | ] |
| 1444 | ] |
| 1445 | ); |
| 1446 | |
| 1447 | $this->add_group_control( |
| 1448 | Group_Control_Typography::get_type(), |
| 1449 | [ |
| 1450 | 'name' => 'eael_product_carousel_rating_count_typography', |
| 1451 | 'selector' => '{{WRAPPER}} .eael-woo-product-carousel-container .woocommerce ul.products .product .eael-star-rating .eael-star-rating-text', |
| 1452 | 'condition' => [ |
| 1453 | 'eael_rating_count' => 'yes' |
| 1454 | ] |
| 1455 | ] |
| 1456 | ); |
| 1457 | |
| 1458 | $this->add_control( |
| 1459 | 'eael_product_carousel_rating_count_color', |
| 1460 | [ |
| 1461 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 1462 | 'type' => Controls_Manager::COLOR, |
| 1463 | 'default' => '#000', |
| 1464 | 'selectors' => [ |
| 1465 | '{{WRAPPER}} .eael-woo-product-carousel-container .woocommerce ul.products .product .eael-star-rating .eael-star-rating-text' => 'color: {{VALUE}}', |
| 1466 | ], |
| 1467 | 'condition' => [ |
| 1468 | 'eael_rating_count' => 'yes' |
| 1469 | ] |
| 1470 | ] |
| 1471 | ); |
| 1472 | |
| 1473 | $this->add_control( |
| 1474 | 'eael_product_carousel_desc_heading', |
| 1475 | [ |
| 1476 | 'label' => __( 'Product Description', 'essential-addons-for-elementor-lite' ), |
| 1477 | 'type' => Controls_Manager::HEADING, |
| 1478 | 'separator' => 'before', |
| 1479 | 'condition' => [ |
| 1480 | 'eael_product_carousel_excerpt' => 'yes', |
| 1481 | ], |
| 1482 | ] |
| 1483 | ); |
| 1484 | |
| 1485 | $this->add_control( |
| 1486 | 'eael_product_carousel_desc_color', |
| 1487 | [ |
| 1488 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 1489 | 'type' => Controls_Manager::COLOR, |
| 1490 | 'default' => '', |
| 1491 | 'selectors' => [ |
| 1492 | '{{WRAPPER}} .eael-product-carousel .eael-product-excerpt' => 'color: {{VALUE}};', |
| 1493 | ], |
| 1494 | 'condition' => [ |
| 1495 | 'eael_product_carousel_excerpt' => 'yes', |
| 1496 | ], |
| 1497 | ] |
| 1498 | ); |
| 1499 | |
| 1500 | $this->add_group_control( |
| 1501 | Group_Control_Typography::get_type(), |
| 1502 | [ |
| 1503 | 'name' => 'eael_product_carousel_desc_typography', |
| 1504 | 'selector' => '{{WRAPPER}} .eael-product-carousel .eael-product-excerpt', |
| 1505 | 'condition' => [ |
| 1506 | 'eael_product_carousel_excerpt' => 'yes', |
| 1507 | ], |
| 1508 | ] |
| 1509 | ); |
| 1510 | |
| 1511 | $this->add_control( |
| 1512 | 'eael_product_carousel_sale_badge_heading', |
| 1513 | [ |
| 1514 | 'label' => __( 'Sale Badge', 'essential-addons-for-elementor-lite' ), |
| 1515 | 'type' => Controls_Manager::HEADING, |
| 1516 | 'separator' => 'before', |
| 1517 | ] |
| 1518 | ); |
| 1519 | |
| 1520 | $this->add_control( |
| 1521 | 'eael_product_carousel_sale_badge_color', |
| 1522 | [ |
| 1523 | 'label' => esc_html__( 'Sale Badge Color', 'essential-addons-for-elementor-lite' ), |
| 1524 | 'type' => Controls_Manager::COLOR, |
| 1525 | 'default' => '#fff', |
| 1526 | 'selectors' => [ |
| 1527 | '{{WRAPPER}} .woocommerce ul.products li.product .onsale, {{WRAPPER}} .woocommerce ul.products li.product .eael-onsale' => 'color: {{VALUE}};', |
| 1528 | ], |
| 1529 | ] |
| 1530 | ); |
| 1531 | |
| 1532 | $this->add_control( |
| 1533 | 'eael_product_carousel_sale_badge_background', |
| 1534 | [ |
| 1535 | 'label' => esc_html__( 'Sale Badge Background', 'essential-addons-for-elementor-lite' ), |
| 1536 | 'type' => Controls_Manager::COLOR, |
| 1537 | 'default' => '#0044FC', |
| 1538 | 'selectors' => [ |
| 1539 | '{{WRAPPER}} .eael-product-carousel .onsale, {{WRAPPER}} .eael-product-carousel .eael-onsale' => 'background-color: {{VALUE}};', |
| 1540 | '{{WRAPPER}} .eael-product-carousel .eael-onsale:not(.outofstock).sale-preset-4:after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', |
| 1541 | ], |
| 1542 | ] |
| 1543 | ); |
| 1544 | |
| 1545 | $this->add_group_control( |
| 1546 | Group_Control_Typography::get_type(), |
| 1547 | [ |
| 1548 | 'name' => 'eael_product_carousel_sale_badge_typo', |
| 1549 | 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product .onsale, {{WRAPPER}} .woocommerce ul.products li.product .eael-onsale:not(.outofstock)', |
| 1550 | ] |
| 1551 | ); |
| 1552 | |
| 1553 | // stock out badge |
| 1554 | $this->add_control( |
| 1555 | 'eael_product_carousel_stock_out_badge_heading', |
| 1556 | [ |
| 1557 | 'label' => __( 'Stock Out Badge', 'essential-addons-for-elementor-lite' ), |
| 1558 | 'type' => Controls_Manager::HEADING, |
| 1559 | ] |
| 1560 | ); |
| 1561 | |
| 1562 | $this->add_control( |
| 1563 | 'eael_product_carousel_stock_out_badge_color', |
| 1564 | [ |
| 1565 | 'label' => esc_html__( 'Stock Out Badge Color', 'essential-addons-for-elementor-lite' ), |
| 1566 | 'type' => Controls_Manager::COLOR, |
| 1567 | 'default' => '#fff', |
| 1568 | 'selectors' => [ |
| 1569 | '{{WRAPPER}} .woocommerce ul.products li.product .outofstock-badge, {{WRAPPER}} .woocommerce ul.products li.product .eael-onsale.outofstock' => 'color: {{VALUE}};', |
| 1570 | ], |
| 1571 | ] |
| 1572 | ); |
| 1573 | |
| 1574 | $this->add_control( |
| 1575 | 'eael_product_carousel_stock_out_badge_background', |
| 1576 | [ |
| 1577 | 'label' => esc_html__( 'Stock Out Badge Background', 'essential-addons-for-elementor-lite' ), |
| 1578 | 'type' => Controls_Manager::COLOR, |
| 1579 | 'default' => '#ff2a13', |
| 1580 | 'selectors' => [ |
| 1581 | '{{WRAPPER}} .woocommerce ul.products li.product .outofstock-badge, {{WRAPPER}} .woocommerce ul.products li.product .eael-onsale.outofstock' => 'background-color: {{VALUE}};', |
| 1582 | '{{WRAPPER}} .woocommerce ul.products li.product .eael-onsale.outofstock.sale-preset-4:after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', |
| 1583 | ], |
| 1584 | ] |
| 1585 | ); |
| 1586 | |
| 1587 | $this->add_group_control( |
| 1588 | Group_Control_Typography::get_type(), |
| 1589 | [ |
| 1590 | 'name' => 'eael_product_carousel_stock_out_badge_typo', |
| 1591 | 'selector' => '{{WRAPPER}} .woocommerce ul.products li.product .outofstock-badge, {{WRAPPER}} .woocommerce ul.products li.product .eael-onsale.outofstock', |
| 1592 | ] |
| 1593 | ); |
| 1594 | |
| 1595 | $this->end_controls_section(); |
| 1596 | } |
| 1597 | |
| 1598 | protected function eael_woo_product_carousel_buttons_style() { |
| 1599 | $this->start_controls_section( |
| 1600 | 'eael_section_product_carousel_buttons_styles', |
| 1601 | [ |
| 1602 | 'label' => esc_html__( 'Button', 'essential-addons-for-elementor-lite' ), |
| 1603 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1604 | ] |
| 1605 | ); |
| 1606 | |
| 1607 | $this->add_control( |
| 1608 | 'eael_product_carousel_buttons_width', |
| 1609 | [ |
| 1610 | 'label' => esc_html__( 'Width', 'essential-addons-for-elementor-lite' ), |
| 1611 | 'type' => Controls_Manager::SLIDER, |
| 1612 | 'range' => [ |
| 1613 | 'px' => [ |
| 1614 | 'max' => 50, |
| 1615 | ], |
| 1616 | ], |
| 1617 | 'selectors' => [ |
| 1618 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a' => 'width: {{SIZE}}px; height: {{SIZE}}px;', |
| 1619 | ], |
| 1620 | 'condition' => [ |
| 1621 | 'eael_dynamic_template_layout!' => 'preset-3', |
| 1622 | ] |
| 1623 | ] |
| 1624 | ); |
| 1625 | |
| 1626 | $this->add_control( |
| 1627 | 'eael_product_carousel_buttons_height', |
| 1628 | [ |
| 1629 | 'label' => esc_html__( 'Height', 'essential-addons-for-elementor-lite' ), |
| 1630 | 'type' => Controls_Manager::SLIDER, |
| 1631 | 'range' => [ |
| 1632 | 'px' => [ |
| 1633 | 'max' => 50, |
| 1634 | ], |
| 1635 | ], |
| 1636 | 'selectors' => [ |
| 1637 | '{{WRAPPER}} .eael-product-carousel .icons-wrap' => 'height: {{SIZE}}px;', |
| 1638 | ], |
| 1639 | 'condition' => [ |
| 1640 | 'eael_dynamic_template_layout' => 'preset-3', |
| 1641 | ] |
| 1642 | ] |
| 1643 | ); |
| 1644 | |
| 1645 | $this->add_control( |
| 1646 | 'eael_product_carousel_buttons_icon_size', |
| 1647 | [ |
| 1648 | 'label' => esc_html__( 'Icons Size', 'essential-addons-for-elementor-lite' ), |
| 1649 | 'type' => Controls_Manager::SLIDER, |
| 1650 | 'range' => [ |
| 1651 | 'px' => [ |
| 1652 | 'max' => 50, |
| 1653 | ], |
| 1654 | ], |
| 1655 | 'selectors' => [ |
| 1656 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a i, {{WRAPPER}} .eael-product-carousel .icons-wrap li.add-to-cart a:before' => 'font-size: {{SIZE}}px;', |
| 1657 | ], |
| 1658 | ] |
| 1659 | ); |
| 1660 | |
| 1661 | $this->add_control( |
| 1662 | 'eael_product_carousel_buttons_preset3_border_color', |
| 1663 | [ |
| 1664 | 'label' => esc_html__( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 1665 | 'type' => Controls_Manager::COLOR, |
| 1666 | 'default' => '#fff', |
| 1667 | 'selectors' => [ |
| 1668 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li' => 'border-color: {{VALUE}};', |
| 1669 | ], |
| 1670 | 'condition' => [ |
| 1671 | 'eael_dynamic_template_layout' => 'preset-3', |
| 1672 | ] |
| 1673 | ] |
| 1674 | ); |
| 1675 | |
| 1676 | $this->start_controls_tabs( 'eael_product_carousel_buttons_style_tabs' ); |
| 1677 | |
| 1678 | $this->start_controls_tab( 'eael_product_carousel_buttons_style_tabs_normal', |
| 1679 | ['label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite' )] ); |
| 1680 | |
| 1681 | $this->add_control( |
| 1682 | 'eael_product_carousel_buttons_color', |
| 1683 | [ |
| 1684 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 1685 | 'type' => Controls_Manager::COLOR, |
| 1686 | 'selectors' => [ |
| 1687 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a' => 'color: {{VALUE}} !important;', |
| 1688 | ], |
| 1689 | ] |
| 1690 | ); |
| 1691 | |
| 1692 | $this->add_control( |
| 1693 | 'eael_product_carousel_buttons_background', |
| 1694 | [ |
| 1695 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 1696 | 'type' => Controls_Manager::COLOR, |
| 1697 | 'selectors' => [ |
| 1698 | '{{WRAPPER}} .eael-product-carousel .icons-wrap.block-style' => 'background-color: {{VALUE}} !important;', |
| 1699 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a' => 'background-color: {{VALUE}} !important;', |
| 1700 | ], |
| 1701 | ] |
| 1702 | ); |
| 1703 | |
| 1704 | $this->add_group_control( |
| 1705 | Group_Control_Border::get_type(), |
| 1706 | [ |
| 1707 | 'name' => 'eael_product_carousel_buttons_border', |
| 1708 | 'selector' => '{{WRAPPER}} .eael-product-carousel .button.add_to_cart_button, {{WRAPPER}} .eael-product-carousel .icons-wrap li a', |
| 1709 | 'condition' => [ |
| 1710 | 'eael_dynamic_template_layout!' => 'preset-3', |
| 1711 | ] |
| 1712 | ] |
| 1713 | ); |
| 1714 | $this->add_control( |
| 1715 | 'eael_product_carousel_buttons_border_radius', |
| 1716 | [ |
| 1717 | 'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 1718 | 'type' => Controls_Manager::SLIDER, |
| 1719 | 'range' => [ |
| 1720 | 'px' => [ |
| 1721 | 'max' => 100, |
| 1722 | ], |
| 1723 | ], |
| 1724 | 'default' => [ |
| 1725 | 'size' => 3, |
| 1726 | ], |
| 1727 | 'selectors' => [ |
| 1728 | '{{WRAPPER}} .eael-product-carousel .icons-wrap:not(.details-block-style-2) li a' => 'border-radius: {{SIZE}}px;', |
| 1729 | '{{WRAPPER}} .eael-product-carousel .icons-wrap.details-block-style-2 li:only-child a' => 'border-radius: {{SIZE}}px!important;', |
| 1730 | '{{WRAPPER}} .eael-product-carousel .icons-wrap.details-block-style-2 li:first-child a' => 'border-radius: {{SIZE}}px 0 0 {{SIZE}}px;', |
| 1731 | '{{WRAPPER}} .eael-product-carousel .icons-wrap.details-block-style-2 li:last-child a' => 'border-radius: 0 {{SIZE}}px {{SIZE}}px 0;', |
| 1732 | ], |
| 1733 | 'condition' => [ |
| 1734 | 'eael_dynamic_template_layout!' => 'preset-3', |
| 1735 | ] |
| 1736 | ] |
| 1737 | ); |
| 1738 | |
| 1739 | $this->add_control( |
| 1740 | 'eael_product_carousel_buttons_top_spacing', |
| 1741 | [ |
| 1742 | 'label' => esc_html__( 'Top Spacing', 'essential-addons-for-elementor-lite' ), |
| 1743 | 'type' => Controls_Manager::SLIDER, |
| 1744 | 'range' => [ |
| 1745 | 'px' => [ |
| 1746 | 'max' => 100, |
| 1747 | ], |
| 1748 | ], |
| 1749 | 'selectors' => [ |
| 1750 | '{{WRAPPER}} .eael-product-carousel .icons-wrap' => 'margin-top: {{SIZE}}px;', |
| 1751 | ], |
| 1752 | 'condition' => [ |
| 1753 | 'eael_dynamic_template_layout' => 'preset-4', |
| 1754 | ] |
| 1755 | ] |
| 1756 | ); |
| 1757 | |
| 1758 | $this->end_controls_tab(); |
| 1759 | |
| 1760 | $this->start_controls_tab( 'eael_product_carousel_buttons_hover_styles', |
| 1761 | ['label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite' )] ); |
| 1762 | |
| 1763 | $this->add_control( |
| 1764 | 'eael_product_carousel_buttons_hover_color', |
| 1765 | [ |
| 1766 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 1767 | 'type' => Controls_Manager::COLOR, |
| 1768 | 'selectors' => [ |
| 1769 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a:hover' => 'color: {{VALUE}} !important;', |
| 1770 | ], |
| 1771 | ] |
| 1772 | ); |
| 1773 | |
| 1774 | $this->add_control( |
| 1775 | 'eael_product_carousel_buttons_hover_background', |
| 1776 | [ |
| 1777 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 1778 | 'type' => Controls_Manager::COLOR, |
| 1779 | 'selectors' => [ |
| 1780 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a:hover' => 'background-color: {{VALUE}} !important;', |
| 1781 | ], |
| 1782 | ] |
| 1783 | ); |
| 1784 | |
| 1785 | $this->add_control( |
| 1786 | 'eael_product_carousel_buttons_hover_border_color', |
| 1787 | [ |
| 1788 | 'label' => esc_html__( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 1789 | 'type' => Controls_Manager::COLOR, |
| 1790 | 'default' => '', |
| 1791 | 'selectors' => [ |
| 1792 | '{{WRAPPER}} .eael-product-carousel .icons-wrap li a:hover' => 'border-color: {{VALUE}};', |
| 1793 | ], |
| 1794 | 'condition' => [ |
| 1795 | 'eael_product_carousel_buttons_border_border!' => '', |
| 1796 | ], |
| 1797 | ] |
| 1798 | ); |
| 1799 | |
| 1800 | $this->end_controls_tab(); |
| 1801 | |
| 1802 | $this->end_controls_tabs(); |
| 1803 | |
| 1804 | $this->end_controls_section(); |
| 1805 | } |
| 1806 | |
| 1807 | protected function eael_product_view_popup_style() { |
| 1808 | $this->start_controls_section( |
| 1809 | 'eael_product_popup', |
| 1810 | [ |
| 1811 | 'label' => __( 'Popup', 'essential-addons-for-elementor-lite' ), |
| 1812 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1813 | ] |
| 1814 | ); |
| 1815 | |
| 1816 | $this->add_control( |
| 1817 | 'eael_product_popup_title', |
| 1818 | [ |
| 1819 | 'label' => __( 'Title', 'essential-addons-for-elementor-lite' ), |
| 1820 | 'type' => Controls_Manager::HEADING, |
| 1821 | ] |
| 1822 | ); |
| 1823 | |
| 1824 | $this->add_group_control( |
| 1825 | Group_Control_Typography::get_type(), |
| 1826 | [ |
| 1827 | 'name' => 'eael_product_popup_title_typography', |
| 1828 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 1829 | 'selector' => '.eael-popup-details-render{{WRAPPER}} div.product .product_title', |
| 1830 | ] |
| 1831 | ); |
| 1832 | |
| 1833 | $this->add_control( |
| 1834 | 'eael_product_popup_title_color', |
| 1835 | [ |
| 1836 | 'label' => __( 'Title Color', 'essential-addons-for-elementor-lite' ), |
| 1837 | 'type' => Controls_Manager::COLOR, |
| 1838 | 'default' => '#252525', |
| 1839 | 'selectors' => [ |
| 1840 | '.eael-popup-details-render{{WRAPPER}} .eael-product-quick-view-title.product_title.entry-title' => 'color: {{VALUE}};', |
| 1841 | ], |
| 1842 | ] |
| 1843 | ); |
| 1844 | |
| 1845 | $this->add_control( |
| 1846 | 'eael_product_popup_price', |
| 1847 | [ |
| 1848 | 'label' => __( 'Price', 'essential-addons-for-elementor-lite' ), |
| 1849 | 'type' => Controls_Manager::HEADING, |
| 1850 | 'separator' => 'before', |
| 1851 | ] |
| 1852 | ); |
| 1853 | |
| 1854 | $this->add_group_control( |
| 1855 | Group_Control_Typography::get_type(), |
| 1856 | [ |
| 1857 | 'name' => 'eael_product_popup_price_typography', |
| 1858 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 1859 | 'selector' => '.eael-popup-details-render{{WRAPPER}} div.product .price', |
| 1860 | ] |
| 1861 | ); |
| 1862 | |
| 1863 | $this->add_control( |
| 1864 | 'eael_product_popup_price_color', |
| 1865 | [ |
| 1866 | 'label' => __( 'Price Color', 'essential-addons-for-elementor-lite' ), |
| 1867 | 'type' => Controls_Manager::COLOR, |
| 1868 | 'default' => '#0242e4', |
| 1869 | 'selectors' => [ |
| 1870 | '.eael-popup-details-render{{WRAPPER}} div.product .price' => 'color: {{VALUE}}!important;', |
| 1871 | ], |
| 1872 | ] |
| 1873 | ); |
| 1874 | |
| 1875 | $this->add_control( |
| 1876 | 'eael_product_popup_sale_price_color', |
| 1877 | [ |
| 1878 | 'label' => __( 'Sale Price Color', 'essential-addons-for-elementor-lite' ), |
| 1879 | 'type' => Controls_Manager::COLOR, |
| 1880 | 'default' => '#ff2a13', |
| 1881 | 'selectors' => [ |
| 1882 | '.eael-popup-details-render{{WRAPPER}} div.product .price ins' => 'color: {{VALUE}}!important;', |
| 1883 | ], |
| 1884 | ] |
| 1885 | ); |
| 1886 | |
| 1887 | $this->add_control( |
| 1888 | 'eael_product_popup_content', |
| 1889 | [ |
| 1890 | 'label' => __( 'Content', 'essential-addons-for-elementor-lite' ), |
| 1891 | 'type' => Controls_Manager::HEADING, |
| 1892 | 'separator' => 'before', |
| 1893 | ] |
| 1894 | ); |
| 1895 | |
| 1896 | $this->add_group_control( |
| 1897 | Group_Control_Typography::get_type(), |
| 1898 | [ |
| 1899 | 'name' => 'eael_product_popup_content_typography', |
| 1900 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 1901 | 'selector' => '.eael-popup-details-render{{WRAPPER}} div.product .woocommerce-product-details__short-description', |
| 1902 | ] |
| 1903 | ); |
| 1904 | |
| 1905 | $this->add_control( |
| 1906 | 'eael_product_popup_content_color', |
| 1907 | [ |
| 1908 | 'label' => __( 'Content Color', 'essential-addons-for-elementor-lite' ), |
| 1909 | 'type' => Controls_Manager::COLOR, |
| 1910 | 'default' => '#707070', |
| 1911 | 'selectors' => [ |
| 1912 | '.eael-popup-details-render{{WRAPPER}} .woocommerce-product-details__short-description' => 'color: {{VALUE}};', |
| 1913 | ], |
| 1914 | ] |
| 1915 | ); |
| 1916 | |
| 1917 | $this->add_control( |
| 1918 | 'eael_product_popup_review_color', |
| 1919 | [ |
| 1920 | 'label' => __( 'Review Color', 'essential-addons-for-elementor-lite' ), |
| 1921 | 'type' => Controls_Manager::COLOR, |
| 1922 | 'default' => '#0274be', |
| 1923 | 'selectors' => [ |
| 1924 | '.eael-popup-details-render{{WRAPPER}} .woocommerce-product-rating .star-rating::before, .eael-popup-details-render{{WRAPPER}} .woocommerce-product-rating .star-rating span::before' => 'color: {{VALUE}};', |
| 1925 | ], |
| 1926 | ] |
| 1927 | ); |
| 1928 | |
| 1929 | $this->add_control( |
| 1930 | 'eael_product_popup_review_link_color', |
| 1931 | [ |
| 1932 | 'label' => __( 'Review Link Color', 'essential-addons-for-elementor-lite' ), |
| 1933 | 'type' => Controls_Manager::COLOR, |
| 1934 | 'default' => '#0274be', |
| 1935 | 'selectors' => [ |
| 1936 | '.eael-popup-details-render{{WRAPPER}} a.woocommerce-review-link' => 'color: {{VALUE}};', |
| 1937 | ], |
| 1938 | ] |
| 1939 | ); |
| 1940 | |
| 1941 | $this->add_control( |
| 1942 | 'eael_product_popup_review_link_hover', |
| 1943 | [ |
| 1944 | 'label' => __( 'Review Link Hover', 'essential-addons-for-elementor-lite' ), |
| 1945 | 'type' => Controls_Manager::COLOR, |
| 1946 | 'default' => '#0274be', |
| 1947 | 'selectors' => [ |
| 1948 | '.eael-popup-details-render{{WRAPPER}} a.woocommerce-review-link:hover' => 'color: {{VALUE}};', |
| 1949 | ], |
| 1950 | ] |
| 1951 | ); |
| 1952 | |
| 1953 | $this->add_control( |
| 1954 | 'eael_product_popup_table_border_color', |
| 1955 | [ |
| 1956 | 'label' => __( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 1957 | 'type' => Controls_Manager::COLOR, |
| 1958 | 'default' => '#ccc', |
| 1959 | 'selectors' => [ |
| 1960 | '.eael-popup-details-render{{WRAPPER}} div.product table tbody tr, {{WRAPPER}} .eael-product-popup.woocommerce div.product .product_meta' => 'border-color: {{VALUE}};', |
| 1961 | ], |
| 1962 | ] |
| 1963 | ); |
| 1964 | |
| 1965 | // Sale |
| 1966 | $this->add_control( |
| 1967 | 'eael_product_popup_sale_style', |
| 1968 | [ |
| 1969 | 'label' => __( 'Sale', 'essential-addons-for-elementor-lite' ), |
| 1970 | 'type' => Controls_Manager::HEADING, |
| 1971 | 'separator' => 'before', |
| 1972 | ] |
| 1973 | ); |
| 1974 | |
| 1975 | $this->add_group_control( |
| 1976 | Group_Control_Typography::get_type(), |
| 1977 | [ |
| 1978 | 'name' => 'eael_product_popup_sale_typo', |
| 1979 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 1980 | 'selector' => '.eael-popup-details-render{{WRAPPER}} .eael-onsale', |
| 1981 | ] |
| 1982 | ); |
| 1983 | $this->add_control( |
| 1984 | 'eael_product_popup_sale_color', |
| 1985 | [ |
| 1986 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 1987 | 'type' => Controls_Manager::COLOR, |
| 1988 | 'selectors' => [ |
| 1989 | '.eael-popup-details-render{{WRAPPER}} .eael-onsale' => 'color: {{VALUE}}!important;', |
| 1990 | ], |
| 1991 | ] |
| 1992 | ); |
| 1993 | $this->add_control( |
| 1994 | 'eael_product_popup_sale_bg_color', |
| 1995 | [ |
| 1996 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 1997 | 'type' => Controls_Manager::COLOR, |
| 1998 | 'selectors' => [ |
| 1999 | '.eael-popup-details-render{{WRAPPER}} .eael-onsale' => 'background-color: {{VALUE}}!important;', |
| 2000 | '.eael-popup-details-render{{WRAPPER}} .eael-onsale:not(.outofstock).sale-preset-4:after' => 'border-left-color: {{VALUE}}; border-right-color: {{VALUE}};', |
| 2001 | ], |
| 2002 | ] |
| 2003 | ); |
| 2004 | |
| 2005 | // Quantity |
| 2006 | $this->add_control( |
| 2007 | 'eael_product_popup_quantity', |
| 2008 | [ |
| 2009 | 'label' => __( 'Quantity', 'essential-addons-for-elementor-lite' ), |
| 2010 | 'type' => Controls_Manager::HEADING, |
| 2011 | 'separator' => 'before', |
| 2012 | ] |
| 2013 | ); |
| 2014 | |
| 2015 | $this->add_group_control( |
| 2016 | Group_Control_Typography::get_type(), |
| 2017 | [ |
| 2018 | 'name' => 'eael_product_popup_quantity_typo', |
| 2019 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 2020 | 'selector' => '.eael-popup-details-render{{WRAPPER}} div.product form.cart div.quantity .qty, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > a', |
| 2021 | ] |
| 2022 | ); |
| 2023 | |
| 2024 | $this->add_control( |
| 2025 | 'eael_product_popup_quantity_color', |
| 2026 | [ |
| 2027 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2028 | 'type' => Controls_Manager::COLOR, |
| 2029 | 'default' => '#000', |
| 2030 | 'selectors' => [ |
| 2031 | '.eael-popup-details-render{{WRAPPER}} div.product form.cart div.quantity .qty, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > a, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > .button' => 'color: {{VALUE}};', |
| 2032 | ], |
| 2033 | ] |
| 2034 | ); |
| 2035 | |
| 2036 | $this->add_control( |
| 2037 | 'eael_product_popup_quantity_bg_color', |
| 2038 | [ |
| 2039 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2040 | 'type' => Controls_Manager::COLOR, |
| 2041 | 'default' => '#fff', |
| 2042 | 'selectors' => [ |
| 2043 | '.eael-popup-details-render{{WRAPPER}} div.product form.cart div.quantity .qty, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > a, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > .button' => 'background-color: {{VALUE}};', |
| 2044 | ], |
| 2045 | ] |
| 2046 | ); |
| 2047 | |
| 2048 | $this->add_control( |
| 2049 | 'eael_product_popup_quantity_border_color', |
| 2050 | [ |
| 2051 | 'label' => esc_html__( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 2052 | 'type' => Controls_Manager::COLOR, |
| 2053 | 'default' => '#000', |
| 2054 | 'selectors' => [ |
| 2055 | '.eael-popup-details-render{{WRAPPER}} div.product form.cart div.quantity .qty, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > a, {{WRAPPER}} .eael-product-popup.woocommerce div.product form.cart div.quantity > .button' => 'border-color: {{VALUE}};', |
| 2056 | // OceanWP |
| 2057 | '.eael-popup-details-render{{WRAPPER}} div.product form.cart div.quantity .qty:focus' => 'border-color: {{VALUE}};', |
| 2058 | ], |
| 2059 | ] |
| 2060 | ); |
| 2061 | |
| 2062 | // Cart Button |
| 2063 | $this->add_control( |
| 2064 | 'eael_product_popup_cart_button', |
| 2065 | [ |
| 2066 | 'label' => __( 'Cart Button', 'essential-addons-for-elementor-lite' ), |
| 2067 | 'type' => Controls_Manager::HEADING, |
| 2068 | 'separator' => 'before', |
| 2069 | ] |
| 2070 | ); |
| 2071 | |
| 2072 | $this->add_group_control( |
| 2073 | Group_Control_Typography::get_type(), |
| 2074 | [ |
| 2075 | 'name' => 'eael_product_popup_cart_button_typo', |
| 2076 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 2077 | 'selector' => '.eael-popup-details-render{{WRAPPER}} .button, .eael-popup-details-render{{WRAPPER}} button.button.alt', |
| 2078 | ] |
| 2079 | ); |
| 2080 | |
| 2081 | $this->start_controls_tabs( 'eael_product_popup_cart_button_style_tabs' ); |
| 2082 | |
| 2083 | $this->start_controls_tab( 'eael_product_popup_cart_button_style_tabs_normal', |
| 2084 | ['label' => esc_html__( 'Normal', 'essential-addons-for-elementor-lite' )] ); |
| 2085 | |
| 2086 | $this->add_control( |
| 2087 | 'eael_product_popup_cart_button_color', |
| 2088 | [ |
| 2089 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2090 | 'type' => Controls_Manager::COLOR, |
| 2091 | 'default' => '#fff', |
| 2092 | 'selectors' => [ |
| 2093 | '.eael-popup-details-render{{WRAPPER}} .button, .eael-popup-details-render{{WRAPPER}} button.button.alt' => 'color: {{VALUE}};', |
| 2094 | ], |
| 2095 | ] |
| 2096 | ); |
| 2097 | |
| 2098 | $this->add_control( |
| 2099 | 'eael_product_popup_cart_button_background', |
| 2100 | [ |
| 2101 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2102 | 'type' => Controls_Manager::COLOR, |
| 2103 | 'default' => '#8040FF', |
| 2104 | 'selectors' => [ |
| 2105 | '.eael-popup-details-render{{WRAPPER}} .button, .eael-popup-details-render{{WRAPPER}} button.button.alt' => 'background-color: {{VALUE}};', |
| 2106 | ], |
| 2107 | ] |
| 2108 | ); |
| 2109 | |
| 2110 | $this->add_group_control( |
| 2111 | Group_Control_Border::get_type(), |
| 2112 | [ |
| 2113 | 'name' => 'eael_product_popup_cart_button_border', |
| 2114 | 'selector' => '.eael-popup-details-render{{WRAPPER}} .button, .eael-popup-details-render{{WRAPPER}} button.button.alt', |
| 2115 | ] |
| 2116 | ); |
| 2117 | $this->add_control( |
| 2118 | 'eael_product_popup_cart_button_border_radius', |
| 2119 | [ |
| 2120 | 'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2121 | 'type' => Controls_Manager::SLIDER, |
| 2122 | 'range' => [ |
| 2123 | 'px' => [ |
| 2124 | 'max' => 100, |
| 2125 | ], |
| 2126 | ], |
| 2127 | 'selectors' => [ |
| 2128 | '.eael-popup-details-render{{WRAPPER}} .button, .eael-popup-details-render{{WRAPPER}} button.button.alt' => 'border-radius: {{SIZE}}px;', |
| 2129 | ], |
| 2130 | ] |
| 2131 | ); |
| 2132 | |
| 2133 | $this->end_controls_tab(); |
| 2134 | |
| 2135 | $this->start_controls_tab( 'eael_product_popup_cart_button_hover_styles', |
| 2136 | ['label' => esc_html__( 'Hover', 'essential-addons-for-elementor-lite' )] ); |
| 2137 | |
| 2138 | $this->add_control( |
| 2139 | 'eael_product_popup_cart_button_hover_color', |
| 2140 | [ |
| 2141 | 'label' => esc_html__( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2142 | 'type' => Controls_Manager::COLOR, |
| 2143 | 'default' => '#F5EAFF', |
| 2144 | 'selectors' => [ |
| 2145 | '.eael-popup-details-render{{WRAPPER}} .button:hover, .eael-popup-details-render{{WRAPPER}} button.button.alt:hover' => 'color: {{VALUE}};', |
| 2146 | ], |
| 2147 | ] |
| 2148 | ); |
| 2149 | |
| 2150 | $this->add_control( |
| 2151 | 'eael_product_popup_cart_button_hover_background', |
| 2152 | [ |
| 2153 | 'label' => esc_html__( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2154 | 'type' => Controls_Manager::COLOR, |
| 2155 | 'default' => '#F12DE0', |
| 2156 | 'selectors' => [ |
| 2157 | '.eael-popup-details-render{{WRAPPER}} .button:hover, .eael-popup-details-render{{WRAPPER}} button.button.alt:hover' => 'background-color: {{VALUE}};', |
| 2158 | ], |
| 2159 | ] |
| 2160 | ); |
| 2161 | |
| 2162 | $this->add_control( |
| 2163 | 'eael_product_popup_cart_button_hover_border_color', |
| 2164 | [ |
| 2165 | 'label' => esc_html__( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 2166 | 'type' => Controls_Manager::COLOR, |
| 2167 | 'default' => '', |
| 2168 | 'selectors' => [ |
| 2169 | '.eael-popup-details-render{{WRAPPER}} .button:hover, .eael-popup-details-render{{WRAPPER}} button.button.alt:hover' => 'border-color: {{VALUE}};', |
| 2170 | ], |
| 2171 | 'condition' => [ |
| 2172 | 'eael_product_popup_cart_button_border_border!' => '', |
| 2173 | ], |
| 2174 | ] |
| 2175 | ); |
| 2176 | |
| 2177 | $this->end_controls_tab(); |
| 2178 | |
| 2179 | $this->end_controls_tabs(); |
| 2180 | |
| 2181 | // SKU |
| 2182 | $this->add_control( |
| 2183 | 'eael_product_popup_sku_style', |
| 2184 | [ |
| 2185 | 'label' => __( 'SKU', 'essential-addons-for-elementor-lite' ), |
| 2186 | 'type' => Controls_Manager::HEADING, |
| 2187 | 'separator' => 'before', |
| 2188 | ] |
| 2189 | ); |
| 2190 | |
| 2191 | $this->add_group_control( |
| 2192 | Group_Control_Typography::get_type(), |
| 2193 | [ |
| 2194 | 'name' => 'eael_product_popup_sku_typo', |
| 2195 | 'label' => __( 'Typography', 'essential-addons-for-elementor-lite' ), |
| 2196 | 'selector' => '.eael-popup-details-render{{WRAPPER}} .product_meta', |
| 2197 | ] |
| 2198 | ); |
| 2199 | $this->add_control( |
| 2200 | 'eael_product_popup_sku_title_color', |
| 2201 | [ |
| 2202 | 'label' => __( 'Title Color', 'essential-addons-for-elementor-lite' ), |
| 2203 | 'type' => Controls_Manager::COLOR, |
| 2204 | 'selectors' => [ |
| 2205 | '.eael-popup-details-render{{WRAPPER}} .product_meta' => 'color: {{VALUE}};', |
| 2206 | ], |
| 2207 | ] |
| 2208 | ); |
| 2209 | $this->add_control( |
| 2210 | 'eael_product_popup_sku_content_color', |
| 2211 | [ |
| 2212 | 'label' => __( 'Content Color', 'essential-addons-for-elementor-lite' ), |
| 2213 | 'type' => Controls_Manager::COLOR, |
| 2214 | 'selectors' => [ |
| 2215 | '.eael-popup-details-render{{WRAPPER}} .product_meta .sku, .eael-popup-details-render{{WRAPPER}} .product_meta a' => 'color: {{VALUE}};', |
| 2216 | ], |
| 2217 | ] |
| 2218 | ); |
| 2219 | $this->add_control( |
| 2220 | 'eael_product_popup_sku_hover_color', |
| 2221 | [ |
| 2222 | 'label' => __( 'Hover Color', 'essential-addons-for-elementor-lite' ), |
| 2223 | 'type' => Controls_Manager::COLOR, |
| 2224 | 'selectors' => [ |
| 2225 | '.eael-popup-details-render{{WRAPPER}} .product_meta a:hover' => 'color: {{VALUE}};', |
| 2226 | ], |
| 2227 | ] |
| 2228 | ); |
| 2229 | |
| 2230 | $this->add_control( |
| 2231 | 'eael_product_popup_close_button_style', |
| 2232 | [ |
| 2233 | 'label' => __( ' Close Button', 'essential-addons-for-elementor-lite' ), |
| 2234 | 'type' => Controls_Manager::HEADING, |
| 2235 | 'separator' => 'before', |
| 2236 | ] |
| 2237 | ); |
| 2238 | |
| 2239 | $this->add_responsive_control( |
| 2240 | 'eael_product_popup_close_button_icon_size', |
| 2241 | [ |
| 2242 | 'label' => __( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 2243 | 'type' => Controls_Manager::SLIDER, |
| 2244 | 'size_units' => ['px', 'em', '%'], |
| 2245 | 'range' => [ |
| 2246 | 'px' => [ |
| 2247 | 'min' => 0, |
| 2248 | 'max' => 100, |
| 2249 | ], |
| 2250 | 'em' => [ |
| 2251 | 'min' => 0, |
| 2252 | 'max' => 100, |
| 2253 | ], |
| 2254 | '%' => [ |
| 2255 | 'min' => 0, |
| 2256 | 'max' => 100, |
| 2257 | ], |
| 2258 | ], |
| 2259 | 'selectors' => [ |
| 2260 | '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close' => 'font-size: {{SIZE}}{{UNIT}};', |
| 2261 | ], |
| 2262 | ] |
| 2263 | ); |
| 2264 | |
| 2265 | $this->add_responsive_control( |
| 2266 | 'eael_product_popup_close_button_size', |
| 2267 | [ |
| 2268 | 'label' => __( 'Button Size', 'essential-addons-for-elementor-lite' ), |
| 2269 | 'type' => Controls_Manager::SLIDER, |
| 2270 | 'size_units' => ['px', 'em', '%'], |
| 2271 | 'range' => [ |
| 2272 | 'px' => [ |
| 2273 | 'min' => 0, |
| 2274 | 'max' => 100, |
| 2275 | ], |
| 2276 | 'em' => [ |
| 2277 | 'min' => 0, |
| 2278 | 'max' => 100, |
| 2279 | ], |
| 2280 | '%' => [ |
| 2281 | 'min' => 0, |
| 2282 | 'max' => 100, |
| 2283 | ], |
| 2284 | ], |
| 2285 | 'selectors' => [ |
| 2286 | '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close' => 'max-width: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}}', |
| 2287 | ], |
| 2288 | ] |
| 2289 | ); |
| 2290 | |
| 2291 | $this->add_control( |
| 2292 | 'eael_product_popup_close_button_color', |
| 2293 | [ |
| 2294 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2295 | 'type' => Controls_Manager::COLOR, |
| 2296 | 'selectors' => [ |
| 2297 | '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close' => 'color: {{VALUE}}!important;', |
| 2298 | ], |
| 2299 | ] |
| 2300 | ); |
| 2301 | |
| 2302 | $this->add_control( |
| 2303 | 'eael_product_popup_close_button_bg', |
| 2304 | [ |
| 2305 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 2306 | 'type' => Controls_Manager::COLOR, |
| 2307 | 'selectors' => [ |
| 2308 | '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close' => 'background-color: {{VALUE}}!important;', |
| 2309 | ], |
| 2310 | ] |
| 2311 | ); |
| 2312 | |
| 2313 | $this->add_control( |
| 2314 | 'eael_product_popup_close_button_border_radius', |
| 2315 | [ |
| 2316 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2317 | 'type' => Controls_Manager::SLIDER, |
| 2318 | 'size_units' => ['px', '%'], |
| 2319 | 'range' => [ |
| 2320 | 'px' => [ |
| 2321 | 'min' => 0, |
| 2322 | 'max' => 100, |
| 2323 | 'step' => 1, |
| 2324 | ], |
| 2325 | '%' => [ |
| 2326 | 'min' => 0, |
| 2327 | 'max' => 100, |
| 2328 | ], |
| 2329 | ], |
| 2330 | 'selectors' => [ |
| 2331 | '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2332 | ], |
| 2333 | ] |
| 2334 | ); |
| 2335 | |
| 2336 | $this->add_group_control( |
| 2337 | Group_Control_Box_Shadow::get_type(), |
| 2338 | [ |
| 2339 | 'name' => 'eael_product_popup_close_button_box_shadow', |
| 2340 | 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 2341 | 'selector' => '.eael-popup-details-render{{WRAPPER}} button.eael-product-popup-close', |
| 2342 | ] |
| 2343 | ); |
| 2344 | |
| 2345 | $this->add_responsive_control( |
| 2346 | 'eael_product_popup_border_radius', |
| 2347 | [ |
| 2348 | 'label' => esc_html__( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2349 | 'type' => Controls_Manager::DIMENSIONS, |
| 2350 | 'size_units' => ['px', '%'], |
| 2351 | 'selectors' => [ |
| 2352 | '.eael-popup-details-render{{WRAPPER}}.eael-product-popup-details' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2353 | ], |
| 2354 | 'separator' => 'before', |
| 2355 | ] |
| 2356 | ); |
| 2357 | |
| 2358 | $this->add_group_control( |
| 2359 | Group_Control_Background::get_type(), |
| 2360 | [ |
| 2361 | 'name' => 'eael_product_popup_background', |
| 2362 | 'label' => __( 'Background', 'essential-addons-for-elementor-lite' ), |
| 2363 | 'types' => ['classic', 'gradient'], |
| 2364 | 'selector' => '.eael-popup-details-render{{WRAPPER}}.eael-product-popup-details', |
| 2365 | 'exclude' => [ |
| 2366 | 'image', |
| 2367 | ], |
| 2368 | ] |
| 2369 | ); |
| 2370 | |
| 2371 | $this->add_group_control( |
| 2372 | Group_Control_Box_Shadow::get_type(), |
| 2373 | [ |
| 2374 | 'name' => 'eael_product_popup_box_shadow', |
| 2375 | 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 2376 | 'selector' => '.eael-popup-details-render{{WRAPPER}}.eael-product-popup-details', |
| 2377 | ] |
| 2378 | ); |
| 2379 | |
| 2380 | $this->end_controls_section(); |
| 2381 | } |
| 2382 | |
| 2383 | protected function eael_woo_product_carousel_dots() { |
| 2384 | /** |
| 2385 | * Style Tab: Dots |
| 2386 | */ |
| 2387 | $this->start_controls_section( |
| 2388 | 'section_dots_style', |
| 2389 | [ |
| 2390 | 'label' => __( 'Dots', 'essential-addons-for-elementor-lite' ), |
| 2391 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2392 | 'condition' => [ |
| 2393 | 'dots' => 'yes', |
| 2394 | ], |
| 2395 | ] |
| 2396 | ); |
| 2397 | |
| 2398 | $this->add_control( |
| 2399 | 'dots_preset', |
| 2400 | [ |
| 2401 | 'label' => __( 'Preset', 'essential-addons-for-elementor-lite' ), |
| 2402 | 'type' => Controls_Manager::SELECT, |
| 2403 | 'options' => [ |
| 2404 | 'dots-preset-1' => __( 'Preset 1', 'essential-addons-for-elementor-lite' ), |
| 2405 | 'dots-preset-2' => __( 'Preset 2', 'essential-addons-for-elementor-lite' ), |
| 2406 | 'dots-preset-3' => __( 'Preset 3', 'essential-addons-for-elementor-lite' ), |
| 2407 | 'dots-preset-4' => __( 'Preset 4', 'essential-addons-for-elementor-lite' ), |
| 2408 | ], |
| 2409 | 'default' => 'dots-preset-1', |
| 2410 | ] |
| 2411 | ); |
| 2412 | |
| 2413 | $this->add_control( |
| 2414 | 'dots_position', |
| 2415 | [ |
| 2416 | 'label' => __( 'Position', 'essential-addons-for-elementor-lite' ), |
| 2417 | 'type' => Controls_Manager::SELECT, |
| 2418 | 'options' => [ |
| 2419 | 'inside' => __( 'Inside', 'essential-addons-for-elementor-lite' ), |
| 2420 | 'outside' => __( 'Outside', 'essential-addons-for-elementor-lite' ), |
| 2421 | ], |
| 2422 | 'default' => 'outside', |
| 2423 | ] |
| 2424 | ); |
| 2425 | |
| 2426 | $this->add_control( |
| 2427 | 'is_use_dots_custom_width_height', |
| 2428 | [ |
| 2429 | 'label' => __( 'Use Custom Width/Height?', 'essential-addons-for-elementor-lite' ), |
| 2430 | 'type' => \Elementor\Controls_Manager::SWITCHER, |
| 2431 | 'label_on' => __( 'Yes', 'essential-addons-for-elementor-lite' ), |
| 2432 | 'label_off' => __( 'No', 'essential-addons-for-elementor-lite' ), |
| 2433 | 'return_value' => 'yes', |
| 2434 | ] |
| 2435 | ); |
| 2436 | |
| 2437 | $this->add_responsive_control( |
| 2438 | 'dots_width', |
| 2439 | [ |
| 2440 | 'label' => __( 'Width', 'essential-addons-for-elementor-lite' ), |
| 2441 | 'type' => Controls_Manager::SLIDER, |
| 2442 | 'range' => [ |
| 2443 | 'px' => [ |
| 2444 | 'min' => 2, |
| 2445 | 'max' => 100, |
| 2446 | 'step' => 1, |
| 2447 | ], |
| 2448 | ], |
| 2449 | 'size_units' => '', |
| 2450 | 'selectors' => [ |
| 2451 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet' => 'width: {{SIZE}}{{UNIT}}', |
| 2452 | ], |
| 2453 | 'condition' => [ |
| 2454 | 'is_use_dots_custom_width_height' => 'yes', |
| 2455 | ], |
| 2456 | ] |
| 2457 | ); |
| 2458 | |
| 2459 | $this->add_responsive_control( |
| 2460 | 'dots_height', |
| 2461 | [ |
| 2462 | 'label' => __( 'Height', 'essential-addons-for-elementor-lite' ), |
| 2463 | 'type' => Controls_Manager::SLIDER, |
| 2464 | 'range' => [ |
| 2465 | 'px' => [ |
| 2466 | 'min' => 2, |
| 2467 | 'max' => 100, |
| 2468 | 'step' => 1, |
| 2469 | ], |
| 2470 | ], |
| 2471 | 'size_units' => '', |
| 2472 | 'selectors' => [ |
| 2473 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}}', |
| 2474 | ], |
| 2475 | 'condition' => [ |
| 2476 | 'is_use_dots_custom_width_height' => 'yes', |
| 2477 | ], |
| 2478 | ] |
| 2479 | ); |
| 2480 | |
| 2481 | $this->add_responsive_control( |
| 2482 | 'dots_size', |
| 2483 | [ |
| 2484 | 'label' => __( 'Size', 'essential-addons-for-elementor-lite' ), |
| 2485 | 'type' => Controls_Manager::SLIDER, |
| 2486 | 'range' => [ |
| 2487 | 'px' => [ |
| 2488 | 'min' => 2, |
| 2489 | 'max' => 100, |
| 2490 | 'step' => 1, |
| 2491 | ], |
| 2492 | ], |
| 2493 | 'size_units' => '', |
| 2494 | 'selectors' => [ |
| 2495 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet' => 'height: {{SIZE}}{{UNIT}}; width: {{SIZE}}{{UNIT}}', |
| 2496 | ], |
| 2497 | 'condition' => [ |
| 2498 | 'is_use_dots_custom_width_height' => '', |
| 2499 | 'dots_preset!' => 'dots-preset-1', |
| 2500 | ], |
| 2501 | ] |
| 2502 | ); |
| 2503 | |
| 2504 | $this->add_responsive_control( |
| 2505 | 'dots_spacing', |
| 2506 | [ |
| 2507 | 'label' => __( 'Spacing', 'essential-addons-for-elementor-lite' ), |
| 2508 | 'type' => Controls_Manager::SLIDER, |
| 2509 | 'range' => [ |
| 2510 | 'px' => [ |
| 2511 | 'min' => 1, |
| 2512 | 'max' => 30, |
| 2513 | 'step' => 1, |
| 2514 | ], |
| 2515 | ], |
| 2516 | 'size_units' => '', |
| 2517 | 'selectors' => [ |
| 2518 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}}', |
| 2519 | ], |
| 2520 | ] |
| 2521 | ); |
| 2522 | |
| 2523 | $this->start_controls_tabs( 'tabs_dots_style' ); |
| 2524 | |
| 2525 | $this->start_controls_tab( |
| 2526 | 'tab_dots_normal', |
| 2527 | [ |
| 2528 | 'label' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 2529 | ] |
| 2530 | ); |
| 2531 | |
| 2532 | $this->add_control( |
| 2533 | 'dots_color_normal', |
| 2534 | [ |
| 2535 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2536 | 'type' => Controls_Manager::COLOR, |
| 2537 | 'default' => '', |
| 2538 | 'selectors' => [ |
| 2539 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet:not(.swiper-pagination-bullet-active)' => 'background: {{VALUE}};', |
| 2540 | ], |
| 2541 | ] |
| 2542 | ); |
| 2543 | |
| 2544 | $this->add_group_control( |
| 2545 | Group_Control_Border::get_type(), |
| 2546 | [ |
| 2547 | 'name' => 'dots_border_normal', |
| 2548 | 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ), |
| 2549 | 'placeholder' => '1px', |
| 2550 | 'default' => '1px', |
| 2551 | 'selector' => '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet', |
| 2552 | ] |
| 2553 | ); |
| 2554 | |
| 2555 | $this->add_control( |
| 2556 | 'dots_border_radius_normal', |
| 2557 | [ |
| 2558 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2559 | 'type' => Controls_Manager::DIMENSIONS, |
| 2560 | 'size_units' => ['px', '%'], |
| 2561 | 'selectors' => [ |
| 2562 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2563 | ], |
| 2564 | ] |
| 2565 | ); |
| 2566 | |
| 2567 | $this->add_responsive_control( |
| 2568 | 'dots_padding', |
| 2569 | [ |
| 2570 | 'label' => __( 'Padding', 'essential-addons-for-elementor-lite' ), |
| 2571 | 'type' => Controls_Manager::DIMENSIONS, |
| 2572 | 'size_units' => ['px', 'em', '%'], |
| 2573 | 'allowed_dimensions' => 'vertical', |
| 2574 | 'placeholder' => [ |
| 2575 | 'top' => '', |
| 2576 | 'right' => 'auto', |
| 2577 | 'bottom' => '', |
| 2578 | 'left' => 'auto', |
| 2579 | ], |
| 2580 | 'selectors' => [ |
| 2581 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullets' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2582 | ], |
| 2583 | ] |
| 2584 | ); |
| 2585 | |
| 2586 | $this->end_controls_tab(); |
| 2587 | |
| 2588 | $this->start_controls_tab( |
| 2589 | 'tab_dots_hover', |
| 2590 | [ |
| 2591 | 'label' => __( 'Hover', 'essential-addons-for-elementor-lite' ), |
| 2592 | ] |
| 2593 | ); |
| 2594 | |
| 2595 | $this->add_control( |
| 2596 | 'dots_color_hover', |
| 2597 | [ |
| 2598 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2599 | 'type' => Controls_Manager::COLOR, |
| 2600 | 'default' => '', |
| 2601 | 'selectors' => [ |
| 2602 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet:hover' => 'background: {{VALUE}};', |
| 2603 | ], |
| 2604 | ] |
| 2605 | ); |
| 2606 | |
| 2607 | $this->add_control( |
| 2608 | 'dots_border_color_hover', |
| 2609 | [ |
| 2610 | 'label' => __( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 2611 | 'type' => Controls_Manager::COLOR, |
| 2612 | 'default' => '', |
| 2613 | 'selectors' => [ |
| 2614 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet:hover' => 'border-color: {{VALUE}};', |
| 2615 | ], |
| 2616 | ] |
| 2617 | ); |
| 2618 | |
| 2619 | $this->end_controls_tab(); |
| 2620 | |
| 2621 | $this->start_controls_tab( |
| 2622 | 'tab_dots_active', |
| 2623 | [ |
| 2624 | 'label' => __( 'Active', 'essential-addons-for-elementor-lite' ), |
| 2625 | ] |
| 2626 | ); |
| 2627 | |
| 2628 | $this->add_control( |
| 2629 | 'active_dot_color_normal', |
| 2630 | [ |
| 2631 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2632 | 'type' => Controls_Manager::COLOR, |
| 2633 | 'default' => '', |
| 2634 | 'selectors' => [ |
| 2635 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet-active' => 'background: {{VALUE}} !important;', |
| 2636 | ], |
| 2637 | ] |
| 2638 | ); |
| 2639 | |
| 2640 | $this->add_responsive_control( |
| 2641 | 'active_dots_width', |
| 2642 | [ |
| 2643 | 'label' => __( 'Width', 'essential-addons-for-elementor-lite' ), |
| 2644 | 'type' => Controls_Manager::SLIDER, |
| 2645 | 'range' => [ |
| 2646 | 'px' => [ |
| 2647 | 'min' => 2, |
| 2648 | 'max' => 100, |
| 2649 | 'step' => 1, |
| 2650 | ], |
| 2651 | ], |
| 2652 | 'size_units' => '', |
| 2653 | 'selectors' => [ |
| 2654 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet-active' => 'width: {{SIZE}}{{UNIT}}', |
| 2655 | ], |
| 2656 | ] |
| 2657 | ); |
| 2658 | |
| 2659 | $this->add_responsive_control( |
| 2660 | 'active_dots_height', |
| 2661 | [ |
| 2662 | 'label' => __( 'Height', 'essential-addons-for-elementor-lite' ), |
| 2663 | 'type' => Controls_Manager::SLIDER, |
| 2664 | 'range' => [ |
| 2665 | 'px' => [ |
| 2666 | 'min' => 2, |
| 2667 | 'max' => 100, |
| 2668 | 'step' => 1, |
| 2669 | ], |
| 2670 | ], |
| 2671 | 'size_units' => '', |
| 2672 | 'selectors' => [ |
| 2673 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet-active' => 'height: {{SIZE}}{{UNIT}}', |
| 2674 | ], |
| 2675 | ] |
| 2676 | ); |
| 2677 | |
| 2678 | $this->add_control( |
| 2679 | 'active_dots_radius', |
| 2680 | [ |
| 2681 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2682 | 'type' => Controls_Manager::DIMENSIONS, |
| 2683 | 'size_units' => ['px', '%'], |
| 2684 | 'selectors' => [ |
| 2685 | '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet-active' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2686 | ], |
| 2687 | ] |
| 2688 | ); |
| 2689 | |
| 2690 | $this->add_group_control( |
| 2691 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 2692 | [ |
| 2693 | 'name' => 'active_dots_shadow', |
| 2694 | 'label' => __( 'Shadow', 'essential-addons-for-elementor-lite' ), |
| 2695 | 'selector' => '{{WRAPPER}} .swiper-container-wrap .swiper-pagination-bullet-active', |
| 2696 | ] |
| 2697 | ); |
| 2698 | |
| 2699 | $this->end_controls_tab(); |
| 2700 | |
| 2701 | $this->end_controls_tabs(); |
| 2702 | |
| 2703 | $this->end_controls_section(); |
| 2704 | } |
| 2705 | |
| 2706 | protected function eael_woo_product_carousel_image_dots(){ |
| 2707 | /** |
| 2708 | * Image Dots |
| 2709 | */ |
| 2710 | $this->start_controls_section( |
| 2711 | 'section_image_dots_style', |
| 2712 | [ |
| 2713 | 'label' => __('Images Dots', 'essential-addons-for-elementor-lite'), |
| 2714 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2715 | 'condition' => [ |
| 2716 | 'image_dots' => 'yes', |
| 2717 | ], |
| 2718 | ] |
| 2719 | ); |
| 2720 | $this->add_responsive_control( |
| 2721 | 'eael_image_dots_width', |
| 2722 | [ |
| 2723 | 'label' => __('Width', 'essential-addons-for-elementor-lite'), |
| 2724 | 'type' => Controls_Manager::SLIDER, |
| 2725 | 'size_units' => ['px', '%'], |
| 2726 | 'range' => [ |
| 2727 | 'px' => [ |
| 2728 | 'min' => 0, |
| 2729 | 'max' => 1000, |
| 2730 | 'step' => 5, |
| 2731 | ], |
| 2732 | '%' => [ |
| 2733 | 'min' => 0, |
| 2734 | 'max' => 100, |
| 2735 | ], |
| 2736 | ], |
| 2737 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 2738 | 'default' => [ |
| 2739 | 'unit' => 'px', |
| 2740 | 'size' => 350, |
| 2741 | ], |
| 2742 | 'selectors' => [ |
| 2743 | '{{WRAPPER}} .eael-woo-product-carousel-gallary-pagination' => 'width: {{SIZE}}{{UNIT}} !important;', |
| 2744 | ], |
| 2745 | ] |
| 2746 | ); |
| 2747 | $this->add_responsive_control( |
| 2748 | 'eael_image_dots_height', |
| 2749 | [ |
| 2750 | 'label' => __('Height', 'essential-addons-for-elementor-lite'), |
| 2751 | 'type' => Controls_Manager::SLIDER, |
| 2752 | 'size_units' => ['px', '%'], |
| 2753 | 'range' => [ |
| 2754 | 'px' => [ |
| 2755 | 'min' => 0, |
| 2756 | 'max' => 1000, |
| 2757 | 'step' => 5, |
| 2758 | ], |
| 2759 | '%' => [ |
| 2760 | 'min' => 0, |
| 2761 | 'max' => 100, |
| 2762 | ], |
| 2763 | ], |
| 2764 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 2765 | 'default' => [ |
| 2766 | 'unit' => 'px', |
| 2767 | 'size' => 100, |
| 2768 | ], |
| 2769 | 'selectors' => [ |
| 2770 | '{{WRAPPER}} .eael-woo-product-carousel-gallary-pagination' => 'height: {{SIZE}}{{UNIT}} !important;', |
| 2771 | ], |
| 2772 | ] |
| 2773 | ); |
| 2774 | |
| 2775 | $this->add_responsive_control( |
| 2776 | 'eael_image_dots_image_size', |
| 2777 | [ |
| 2778 | 'label' => __('Image Size', 'essential-addons-for-elementor-lite'), |
| 2779 | 'type' => Controls_Manager::SLIDER, |
| 2780 | 'size_units' => ['px', '%'], |
| 2781 | 'range' => [ |
| 2782 | 'px' => [ |
| 2783 | 'min' => 0, |
| 2784 | 'max' => 500, |
| 2785 | 'step' => 5, |
| 2786 | ], |
| 2787 | '%' => [ |
| 2788 | 'min' => 0, |
| 2789 | 'max' => 100, |
| 2790 | ], |
| 2791 | ], |
| 2792 | 'devices' => ['desktop', 'tablet', 'mobile'], |
| 2793 | 'default' => [ |
| 2794 | 'unit' => 'px', |
| 2795 | 'size' => 100, |
| 2796 | ], |
| 2797 | 'selectors' => [ |
| 2798 | '{{WRAPPER}} .eael-woo-product-carousel-gallary-pagination img' => 'width: {{SIZE}}{{UNIT}} !important;height: {{SIZE}}{{UNIT}} !important;', |
| 2799 | ], |
| 2800 | ] |
| 2801 | ); |
| 2802 | $this->add_control( |
| 2803 | 'eael_image_dots_image_border_radius', |
| 2804 | [ |
| 2805 | 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), |
| 2806 | 'type' => Controls_Manager::SLIDER, |
| 2807 | 'size_units' => ['px', '%'], |
| 2808 | 'range' => [ |
| 2809 | 'px' => [ |
| 2810 | 'min' => 0, |
| 2811 | 'max' => 1000, |
| 2812 | 'step' => 5, |
| 2813 | ], |
| 2814 | '%' => [ |
| 2815 | 'min' => 0, |
| 2816 | 'max' => 100, |
| 2817 | ], |
| 2818 | ], |
| 2819 | 'selectors' => [ |
| 2820 | '{{WRAPPER}} .eael-woo-product-carousel-gallary-pagination img' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2821 | ], |
| 2822 | ] |
| 2823 | ); |
| 2824 | |
| 2825 | $this->end_controls_section(); |
| 2826 | } |
| 2827 | |
| 2828 | protected function eael_woo_product_carousel_arrows() { |
| 2829 | /** |
| 2830 | * Style Tab: Arrows |
| 2831 | */ |
| 2832 | $this->start_controls_section( |
| 2833 | 'section_arrows_style', |
| 2834 | [ |
| 2835 | 'label' => __( 'Arrows', 'essential-addons-for-elementor-lite' ), |
| 2836 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2837 | 'condition' => [ |
| 2838 | 'arrows' => 'yes', |
| 2839 | ], |
| 2840 | ] |
| 2841 | ); |
| 2842 | |
| 2843 | $this->add_control( |
| 2844 | 'arrow', |
| 2845 | [ |
| 2846 | 'label' => __( 'Choose Arrow', 'essential-addons-for-elementor-lite' ), |
| 2847 | 'type' => Controls_Manager::SELECT, |
| 2848 | 'label_block' => true, |
| 2849 | 'default' => 'fa fa-angle-right', |
| 2850 | 'options' => [ |
| 2851 | 'fa fa-angle-right' => __( 'Angle', 'essential-addons-for-elementor-lite' ), |
| 2852 | 'fa fa-angle-double-right' => __( 'Double Angle', 'essential-addons-for-elementor-lite' ), |
| 2853 | 'fa fa-chevron-right' => __( 'Chevron', 'essential-addons-for-elementor-lite' ), |
| 2854 | 'fa fa-chevron-circle-right' => __( 'Chevron Circle', 'essential-addons-for-elementor-lite' ), |
| 2855 | 'fa fa-arrow-right' => __( 'Arrow', 'essential-addons-for-elementor-lite' ), |
| 2856 | 'fa fa-long-arrow-right' => __( 'Long Arrow', 'essential-addons-for-elementor-lite' ), |
| 2857 | 'fa fa-caret-right' => __( 'Caret', 'essential-addons-for-elementor-lite' ), |
| 2858 | 'fa fa-caret-square-o-right' => __( 'Caret Square', 'essential-addons-for-elementor-lite' ), |
| 2859 | 'fa fa-arrow-circle-right' => __( 'Arrow Circle', 'essential-addons-for-elementor-lite' ), |
| 2860 | 'fa fa-arrow-circle-o-right' => __( 'Arrow Circle O', 'essential-addons-for-elementor-lite' ), |
| 2861 | 'fa fa-toggle-right' => __( 'Toggle', 'essential-addons-for-elementor-lite' ), |
| 2862 | 'fa fa-hand-o-right' => __( 'Hand', 'essential-addons-for-elementor-lite' ), |
| 2863 | ], |
| 2864 | ] |
| 2865 | ); |
| 2866 | |
| 2867 | $this->add_responsive_control( |
| 2868 | 'arrows_size', |
| 2869 | [ |
| 2870 | 'label' => __( 'Arrows Size', 'essential-addons-for-elementor-lite' ), |
| 2871 | 'type' => Controls_Manager::SLIDER, |
| 2872 | 'default' => ['size' => '40'], |
| 2873 | 'range' => [ |
| 2874 | 'px' => [ |
| 2875 | 'min' => 15, |
| 2876 | 'max' => 100, |
| 2877 | 'step' => 1, |
| 2878 | ], |
| 2879 | ], |
| 2880 | 'size_units' => ['px'], |
| 2881 | 'selectors' => [ |
| 2882 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 2883 | ], |
| 2884 | ] |
| 2885 | ); |
| 2886 | |
| 2887 | $this->add_responsive_control( |
| 2888 | 'arrows_icon_size', |
| 2889 | [ |
| 2890 | 'label' => __( 'Icon Size', 'essential-addons-for-elementor-lite' ), |
| 2891 | 'type' => Controls_Manager::SLIDER, |
| 2892 | 'default' => ['size' => '22'], |
| 2893 | 'range' => [ |
| 2894 | 'px' => [ |
| 2895 | 'min' => 15, |
| 2896 | 'max' => 100, |
| 2897 | 'step' => 1, |
| 2898 | ], |
| 2899 | ], |
| 2900 | 'size_units' => ['px'], |
| 2901 | 'selectors' => [ |
| 2902 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'font-size: {{SIZE}}{{UNIT}};', |
| 2903 | ], |
| 2904 | ] |
| 2905 | ); |
| 2906 | |
| 2907 | $this->add_responsive_control( |
| 2908 | 'left_arrow_position', |
| 2909 | [ |
| 2910 | 'label' => __( 'Align Left Arrow', 'essential-addons-for-elementor-lite' ), |
| 2911 | 'type' => Controls_Manager::SLIDER, |
| 2912 | 'range' => [ |
| 2913 | 'px' => [ |
| 2914 | 'min' => -100, |
| 2915 | 'max' => 40, |
| 2916 | 'step' => 1, |
| 2917 | ], |
| 2918 | ], |
| 2919 | 'size_units' => ['px'], |
| 2920 | 'selectors' => [ |
| 2921 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'left: {{SIZE}}{{UNIT}};', |
| 2922 | ], |
| 2923 | ] |
| 2924 | ); |
| 2925 | |
| 2926 | $this->add_responsive_control( |
| 2927 | 'right_arrow_position', |
| 2928 | [ |
| 2929 | 'label' => __( 'Align Right Arrow', 'essential-addons-for-elementor-lite' ), |
| 2930 | 'type' => Controls_Manager::SLIDER, |
| 2931 | 'range' => [ |
| 2932 | 'px' => [ |
| 2933 | 'min' => -100, |
| 2934 | 'max' => 40, |
| 2935 | 'step' => 1, |
| 2936 | ], |
| 2937 | ], |
| 2938 | 'size_units' => ['px'], |
| 2939 | 'selectors' => [ |
| 2940 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next' => 'right: {{SIZE}}{{UNIT}};', |
| 2941 | ], |
| 2942 | ] |
| 2943 | ); |
| 2944 | |
| 2945 | $this->start_controls_tabs( 'tabs_arrows_style' ); |
| 2946 | |
| 2947 | $this->start_controls_tab( |
| 2948 | 'tab_arrows_normal', |
| 2949 | [ |
| 2950 | 'label' => __( 'Normal', 'essential-addons-for-elementor-lite' ), |
| 2951 | ] |
| 2952 | ); |
| 2953 | |
| 2954 | $this->add_control( |
| 2955 | 'arrows_bg_color_normal', |
| 2956 | [ |
| 2957 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 2958 | 'type' => Controls_Manager::COLOR, |
| 2959 | 'default' => '', |
| 2960 | 'selectors' => [ |
| 2961 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'background-color: {{VALUE}};', |
| 2962 | ], |
| 2963 | ] |
| 2964 | ); |
| 2965 | |
| 2966 | $this->add_control( |
| 2967 | 'arrows_color_normal', |
| 2968 | [ |
| 2969 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 2970 | 'type' => Controls_Manager::COLOR, |
| 2971 | 'default' => '', |
| 2972 | 'selectors' => [ |
| 2973 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'color: {{VALUE}};', |
| 2974 | ], |
| 2975 | ] |
| 2976 | ); |
| 2977 | |
| 2978 | $this->add_group_control( |
| 2979 | Group_Control_Border::get_type(), |
| 2980 | [ |
| 2981 | 'name' => 'arrows_border_normal', |
| 2982 | 'label' => __( 'Border', 'essential-addons-for-elementor-lite' ), |
| 2983 | 'placeholder' => '1px', |
| 2984 | 'default' => '1px', |
| 2985 | 'selector' => '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev', |
| 2986 | ] |
| 2987 | ); |
| 2988 | |
| 2989 | $this->add_control( |
| 2990 | 'arrows_border_radius_normal', |
| 2991 | [ |
| 2992 | 'label' => __( 'Border Radius', 'essential-addons-for-elementor-lite' ), |
| 2993 | 'type' => Controls_Manager::DIMENSIONS, |
| 2994 | 'size_units' => ['px', '%'], |
| 2995 | 'selectors' => [ |
| 2996 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2997 | ], |
| 2998 | ] |
| 2999 | ); |
| 3000 | |
| 3001 | $this->end_controls_tab(); |
| 3002 | |
| 3003 | $this->start_controls_tab( |
| 3004 | 'tab_arrows_hover', |
| 3005 | [ |
| 3006 | 'label' => __( 'Hover', 'essential-addons-for-elementor-lite' ), |
| 3007 | ] |
| 3008 | ); |
| 3009 | |
| 3010 | $this->add_control( |
| 3011 | 'arrows_bg_color_hover', |
| 3012 | [ |
| 3013 | 'label' => __( 'Background Color', 'essential-addons-for-elementor-lite' ), |
| 3014 | 'type' => Controls_Manager::COLOR, |
| 3015 | 'default' => '', |
| 3016 | 'selectors' => [ |
| 3017 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next:hover, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev:hover' => 'background-color: {{VALUE}};', |
| 3018 | ], |
| 3019 | ] |
| 3020 | ); |
| 3021 | |
| 3022 | $this->add_control( |
| 3023 | 'arrows_color_hover', |
| 3024 | [ |
| 3025 | 'label' => __( 'Color', 'essential-addons-for-elementor-lite' ), |
| 3026 | 'type' => Controls_Manager::COLOR, |
| 3027 | 'default' => '', |
| 3028 | 'selectors' => [ |
| 3029 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next:hover, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev:hover' => 'color: {{VALUE}};', |
| 3030 | ], |
| 3031 | ] |
| 3032 | ); |
| 3033 | |
| 3034 | $this->add_control( |
| 3035 | 'arrows_border_color_hover', |
| 3036 | [ |
| 3037 | 'label' => __( 'Border Color', 'essential-addons-for-elementor-lite' ), |
| 3038 | 'type' => Controls_Manager::COLOR, |
| 3039 | 'default' => '', |
| 3040 | 'selectors' => [ |
| 3041 | '{{WRAPPER}} .swiper-container-wrap .swiper-button-next:hover, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev:hover' => 'border-color: {{VALUE}};', |
| 3042 | ], |
| 3043 | ] |
| 3044 | ); |
| 3045 | |
| 3046 | $this->end_controls_tab(); |
| 3047 | |
| 3048 | $this->end_controls_tabs(); |
| 3049 | |
| 3050 | $this->add_group_control( |
| 3051 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 3052 | [ |
| 3053 | 'name' => 'eael_product_carousel_arrow_shadow', |
| 3054 | 'label' => __( 'Box Shadow', 'essential-addons-for-elementor-lite' ), |
| 3055 | 'selector' => '{{WRAPPER}} .swiper-container-wrap .swiper-button-next, {{WRAPPER}} .swiper-container-wrap .swiper-button-prev', |
| 3056 | ] |
| 3057 | ); |
| 3058 | |
| 3059 | $this->end_controls_section(); |
| 3060 | } |
| 3061 | |
| 3062 | protected function render() { |
| 3063 | if ( !function_exists( 'WC' ) ) { |
| 3064 | return; |
| 3065 | } |
| 3066 | |
| 3067 | $settings = $this->get_settings_for_display(); |
| 3068 | // normalize for load more fix |
| 3069 | $widget_id = esc_attr( $this->get_id() ); |
| 3070 | $settings[ 'eael_widget_id' ] = $widget_id; |
| 3071 | |
| 3072 | $args = $this->product_query_builder(); |
| 3073 | if ( Plugin::$instance->documents->get_current() ) { |
| 3074 | $this->page_id = Plugin::$instance->documents->get_current()->get_main_id(); |
| 3075 | } |
| 3076 | |
| 3077 | // render dom |
| 3078 | $this->add_render_attribute( 'container', [ |
| 3079 | 'class' => [ |
| 3080 | 'swiper-container-wrap', |
| 3081 | 'eael-woo-product-carousel-container', |
| 3082 | $settings[ 'eael_dynamic_template_layout' ], |
| 3083 | ], |
| 3084 | 'id' => 'eael-product-carousel-' . esc_attr( $this->get_id() ), |
| 3085 | 'data-widget-id' => $widget_id, |
| 3086 | ] ); |
| 3087 | |
| 3088 | if ( $settings[ 'dots_position' ] ) { |
| 3089 | $this->add_render_attribute( 'container', 'class', |
| 3090 | 'swiper-container-wrap-dots-' . $settings[ 'dots_position' ] ); |
| 3091 | } |
| 3092 | |
| 3093 | $swiper_class = $swiper_version_class = ''; |
| 3094 | if ( class_exists( 'Elementor\Plugin' ) ) { |
| 3095 | $swiper_class = \Elementor\Plugin::$instance->experiments->is_feature_active( 'e_swiper_latest' ) ? 'swiper' : 'swiper-container'; |
| 3096 | $swiper_version_class = 'swiper' === $swiper_class ? 'swiper-8' : 'swiper-8-lower'; |
| 3097 | } |
| 3098 | |
| 3099 | $this->add_render_attribute( |
| 3100 | 'eael-woo-product-carousel-wrap', |
| 3101 | [ |
| 3102 | 'class' => [ |
| 3103 | 'woocommerce', |
| 3104 | esc_attr( $swiper_class ), |
| 3105 | esc_attr( $swiper_version_class ), |
| 3106 | 'eael-woo-product-carousel', |
| 3107 | 'swiper-container-' . esc_attr( $this->get_id() ), |
| 3108 | 'eael-product-appender-' . esc_attr( $this->get_id() ), |
| 3109 | $settings['eael_product_button_appearance'] ? 'eael-'.esc_attr( $settings['eael_product_button_appearance'] ).'-buttons' : '' |
| 3110 | ], |
| 3111 | 'data-pagination' => '.swiper-pagination-' . esc_attr( $this->get_id() ), |
| 3112 | 'data-arrow-next' => '.swiper-button-next-' . esc_attr( $this->get_id() ), |
| 3113 | 'data-arrow-prev' => '.swiper-button-prev-' . esc_attr( $this->get_id() ), |
| 3114 | ] |
| 3115 | ); |
| 3116 | |
| 3117 | if ( $settings[ 'eael_dynamic_template_layout' ] ) { |
| 3118 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-type', |
| 3119 | $settings[ 'eael_dynamic_template_layout' ] ); |
| 3120 | } |
| 3121 | |
| 3122 | if ( $settings[ 'eael_woo_product_carousel_image_stretch' ] ) { |
| 3123 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'class', 'swiper-image-stretch' ); |
| 3124 | } |
| 3125 | |
| 3126 | if ($settings['carousel_effect']) { |
| 3127 | $this->add_render_attribute('eael-woo-product-carousel-wrap', 'data-effect', $settings['carousel_effect']); |
| 3128 | } |
| 3129 | |
| 3130 | if($settings['carousel_effect'] == 'slide'){ |
| 3131 | if ( !empty( $settings[ 'items' ] ) ) { |
| 3132 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-items', $settings[ 'items' ] ); |
| 3133 | } |
| 3134 | if ( !empty( $settings[ 'items' ] ) ) { |
| 3135 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-slide-items', $settings[ 'slide_items' ] ); |
| 3136 | } |
| 3137 | } |
| 3138 | |
| 3139 | if ( method_exists( Plugin::$instance->breakpoints, 'get_breakpoints_config' ) && ! empty( $breakpoints = Plugin::$instance->breakpoints->get_breakpoints_config() ) ) { |
| 3140 | foreach ( $breakpoints as $key => $breakpoint ){ |
| 3141 | if ($breakpoint['is_enabled']) { |
| 3142 | if ( $settings['carousel_effect'] == 'slide' && !empty($settings['items_'.$key]) ) { |
| 3143 | $this->add_render_attribute('eael-woo-product-carousel-wrap', 'data-items-'.$key, $settings['items_'.$key]); |
| 3144 | } |
| 3145 | if ( $settings['carousel_effect'] == 'slide' && !empty($settings['slide_items_'.$key]) ) { |
| 3146 | $this->add_render_attribute('eael-woo-product-carousel-wrap', 'data-slide-items-'.$key, $settings['slide_items_'.$key]); |
| 3147 | } |
| 3148 | if (!empty($settings['margin_'.$key]['size'])) { |
| 3149 | $this->add_render_attribute('eael-woo-product-carousel-wrap', 'data-margin-'.$key, $settings['margin_'.$key]['size']); |
| 3150 | } |
| 3151 | } |
| 3152 | } |
| 3153 | } |
| 3154 | |
| 3155 | if($settings['carousel_effect'] == 'coverflow') { |
| 3156 | if ( !empty( $settings[ 'carousel_depth' ][ 'size' ] ) ) { |
| 3157 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-depth', $settings[ 'carousel_depth' ][ 'size' ] ); |
| 3158 | } |
| 3159 | if ( !empty( $settings[ 'carousel_rotate' ][ 'size' ] ) ) { |
| 3160 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-rotate', |
| 3161 | $settings[ 'carousel_rotate' ][ 'size' ] ); |
| 3162 | } |
| 3163 | if ( !empty( $settings[ 'carousel_stretch' ][ 'size' ] ) ) { |
| 3164 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-stretch', |
| 3165 | $settings[ 'carousel_stretch' ][ 'size' ] ); |
| 3166 | } |
| 3167 | } |
| 3168 | |
| 3169 | if ( !empty( $settings[ 'margin' ][ 'size' ] ) ) { |
| 3170 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-margin', |
| 3171 | $settings[ 'margin' ][ 'size' ] ); |
| 3172 | } |
| 3173 | |
| 3174 | if ( !empty( $settings[ 'slider_speed' ][ 'size' ] ) ) { |
| 3175 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-speed', |
| 3176 | $settings[ 'slider_speed' ][ 'size' ] ); |
| 3177 | } |
| 3178 | |
| 3179 | if( 'yes' === $settings['enable_marquee'] ){ |
| 3180 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-autoplay', '0.001' ); |
| 3181 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'class', 'eael-marquee-carousel' ); |
| 3182 | } |
| 3183 | else if ( $settings[ 'autoplay' ] == 'yes' && !empty( $settings[ 'autoplay_speed' ][ 'size' ] ) ) { |
| 3184 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-autoplay', $settings[ 'autoplay_speed' ][ 'size' ] ); |
| 3185 | } else { |
| 3186 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-autoplay', '0' ); |
| 3187 | } |
| 3188 | |
| 3189 | if ( $settings[ 'pause_on_hover' ] == 'yes' ) { |
| 3190 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-pause-on-hover', 'true' ); |
| 3191 | } |
| 3192 | |
| 3193 | if ( $settings[ 'infinite_loop' ] == 'yes' ) { |
| 3194 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-loop', '1' ); |
| 3195 | } |
| 3196 | if ( $settings[ 'grab_cursor' ] == 'yes' ) { |
| 3197 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-grab-cursor', '1' ); |
| 3198 | } |
| 3199 | if ( $settings[ 'arrows' ] == 'yes' ) { |
| 3200 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-arrows', '1' ); |
| 3201 | } |
| 3202 | if ( $settings[ 'dots' ] == 'yes' ) { |
| 3203 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'data-dots', '1' ); |
| 3204 | } |
| 3205 | |
| 3206 | if ( $settings['direction'] == 'right' ) { |
| 3207 | $this->add_render_attribute( 'eael-woo-product-carousel-wrap', 'dir', 'rtl' ); |
| 3208 | } |
| 3209 | $settings['eael_product_carousel_title_tag'] = HelperClass::eael_validate_html_tag($settings['eael_product_carousel_title_tag']); |
| 3210 | $settings['eael_product_carousel_sale_text'] = HelperClass::eael_wp_kses($settings['eael_product_carousel_sale_text']); |
| 3211 | $settings['eael_product_carousel_stockout_text'] = HelperClass::eael_wp_kses($settings['eael_product_carousel_stockout_text']); |
| 3212 | |
| 3213 | $no_products_found = 0; |
| 3214 | |
| 3215 | if ( is_user_logged_in() ) { |
| 3216 | $product_purchase_type = ! empty( $settings['product_type_logged_users'] ) ? sanitize_text_field( $settings['product_type_logged_users'] ) : ''; |
| 3217 | |
| 3218 | if ( in_array( $product_purchase_type, ['purchased', 'not-purchased'] ) ) { |
| 3219 | $user_ordered_products = HelperClass::eael_get_all_user_ordered_products(); |
| 3220 | $no_products_found = empty( $user_ordered_products ) && 'purchased' === $product_purchase_type ? 1 : 0; |
| 3221 | |
| 3222 | if ( ! empty( $user_ordered_products ) && 'purchased' === $product_purchase_type ){ |
| 3223 | $args['post__in'] = $user_ordered_products; |
| 3224 | } |
| 3225 | |
| 3226 | if ( ! empty( $user_ordered_products ) && 'not-purchased' === $product_purchase_type ){ |
| 3227 | $args['post__not_in'] = $user_ordered_products; |
| 3228 | } |
| 3229 | } |
| 3230 | } |
| 3231 | |
| 3232 | ?> |
| 3233 | |
| 3234 | <div <?php $this->print_render_attribute_string( 'container' ); ?> > |
| 3235 | <?php |
| 3236 | do_action( 'eael_woo_before_product_loop' ); |
| 3237 | |
| 3238 | $template = $this->get_template( $settings[ 'eael_dynamic_template_layout' ] ); |
| 3239 | if ( file_exists( $template ) ): |
| 3240 | $query = new \WP_Query( $args ); |
| 3241 | if ( $query->have_posts() ): |
| 3242 | echo '<div '; $this->print_render_attribute_string( 'eael-woo-product-carousel-wrap' ); echo '>'; |
| 3243 | $settings['eael_page_id'] = $this->page_id ? $this->page_id : get_the_ID(); |
| 3244 | echo '<ul class="swiper-wrapper products">'; |
| 3245 | while ( $query->have_posts() ) { |
| 3246 | $query->the_post(); |
| 3247 | include( $template ); |
| 3248 | } |
| 3249 | wp_reset_postdata(); |
| 3250 | echo '</ul>'; |
| 3251 | do_action( 'eael_woo_after_product_loop' ); |
| 3252 | echo '</div>'; |
| 3253 | else: |
| 3254 | echo '<p class="eael-no-posts-found">' . wp_kses( $settings['eael_product_carousel_not_found_msg'], HelperClass::eael_allowed_tags() ) . '</p>'; |
| 3255 | endif; |
| 3256 | else: |
| 3257 | echo '<p class="eael-no-posts-found">' . esc_html__( 'No layout found!', 'essential-addons-for-elementor-lite' ) . '</p>'; ; |
| 3258 | endif; |
| 3259 | /** |
| 3260 | * Render Slider Dots! |
| 3261 | */ |
| 3262 | |
| 3263 | if( 'yes' !== $settings['enable_marquee'] ){ |
| 3264 | if ( file_exists( $template ) && $settings['image_dots'] === 'yes') { |
| 3265 | $this->render_image_dots($query); |
| 3266 | } else { |
| 3267 | $this->render_dots(); |
| 3268 | } |
| 3269 | } |
| 3270 | |
| 3271 | |
| 3272 | do_action( 'eael_woo_after_product_loop' ); |
| 3273 | /** |
| 3274 | * Render Slider Navigations! |
| 3275 | */ |
| 3276 | |
| 3277 | if( 'yes' !== $settings['enable_marquee'] ){ |
| 3278 | $this->render_arrows(); |
| 3279 | } |
| 3280 | ?> |
| 3281 | </div> |
| 3282 | <?php |
| 3283 | } |
| 3284 | |
| 3285 | //changes |
| 3286 | protected function render_dots() { |
| 3287 | $settings = $this->get_settings_for_display(); |
| 3288 | |
| 3289 | if ( $settings[ 'dots' ] == 'yes' ) { ?> |
| 3290 | <!-- Add Pagination --> |
| 3291 | <div class="swiper-pagination swiper-pagination-<?php echo esc_attr( $this->get_id() .' '. $settings['dots_preset'] ); |
| 3292 | ?>"></div> |
| 3293 | <?php } |
| 3294 | } |
| 3295 | |
| 3296 | protected function render_image_dots($query) |
| 3297 | { |
| 3298 | $settings = $this->get_settings_for_display(); |
| 3299 | |
| 3300 | $visibility = ''; |
| 3301 | if ( $settings['image_dots_visibility'] !== 'yes' ) { |
| 3302 | $visibility .= ' eael_gallery_pagination_hide_on_desktop'; |
| 3303 | } |
| 3304 | |
| 3305 | if ( empty( $settings['image_dots_visibility_mobile'] ) || $settings['image_dots_visibility_mobile'] !== 'yes' ) { |
| 3306 | $visibility .= ' eael_gallery_pagination_hide_on_mobile'; |
| 3307 | } |
| 3308 | |
| 3309 | if ( empty( $settings['image_dots_visibility_tablet'] ) || $settings['image_dots_visibility_tablet'] !== 'yes' ) { |
| 3310 | $visibility .= ' eael_gallery_pagination_hide_on_tablet'; |
| 3311 | } |
| 3312 | |
| 3313 | $this->add_render_attribute('eael_gallery_pagination_wrapper', [ |
| 3314 | 'class' => ['swiper swiper-container eael-woo-product-carousel-gallary-pagination', $visibility] |
| 3315 | ]); |
| 3316 | |
| 3317 | if ( $settings['direction'] == 'right' ) { |
| 3318 | $this->add_render_attribute( 'eael_gallery_pagination_wrapper', 'dir', 'rtl' ); |
| 3319 | } |
| 3320 | |
| 3321 | |
| 3322 | if ($settings['image_dots'] === 'yes') : ?> |
| 3323 | |
| 3324 | <div <?php $this->print_render_attribute_string('eael_gallery_pagination_wrapper'); ?>> |
| 3325 | |
| 3326 | <?php |
| 3327 | if ( $query->have_posts() ) { |
| 3328 | echo '<div class="swiper-wrapper">'; |
| 3329 | while ( $query->have_posts() ) { |
| 3330 | $query->the_post(); |
| 3331 | $image_arr = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ),'full'); |
| 3332 | if(empty($image_arr)){ |
| 3333 | $image_arr[0] = wc_placeholder_img_src( 'full' ); |
| 3334 | } |
| 3335 | |
| 3336 | echo '<div class="swiper-slide">'; |
| 3337 | echo '<div class="swiper-slide-container">'; |
| 3338 | echo '<div class="eael-pagination-thumb">'; |
| 3339 | echo '<img class="eael-thumbnail" src="'.esc_url(current($image_arr)).'">'; |
| 3340 | echo '</div>'; |
| 3341 | echo '</div>'; |
| 3342 | echo '</div>'; |
| 3343 | } |
| 3344 | wp_reset_postdata(); |
| 3345 | echo '</div>'; |
| 3346 | } |
| 3347 | ?> |
| 3348 | |
| 3349 | </div> |
| 3350 | <?php |
| 3351 | endif; |
| 3352 | } |
| 3353 | |
| 3354 | /** |
| 3355 | * Render logo carousel arrows output on the frontend. |
| 3356 | */ |
| 3357 | protected function render_arrows() { |
| 3358 | $settings = $this->get_settings_for_display(); |
| 3359 | |
| 3360 | if ( $settings[ 'arrows' ] == 'yes' ) { ?> |
| 3361 | <?php |
| 3362 | if ( $settings[ 'arrow' ] ) { |
| 3363 | $pa_next_arrow = $settings[ 'arrow' ]; |
| 3364 | $pa_prev_arrow = str_replace( "right", "left", $settings[ 'arrow' ] ); |
| 3365 | } else { |
| 3366 | $pa_next_arrow = 'fa fa-angle-right'; |
| 3367 | $pa_prev_arrow = 'fa fa-angle-left'; |
| 3368 | } |
| 3369 | ?> |
| 3370 | <!-- Add Arrows --> |
| 3371 | <div class="swiper-button-next swiper-button-next-<?php echo esc_attr( $this->get_id() ); ?>"> |
| 3372 | <i class="<?php echo esc_attr( $pa_next_arrow ); ?>"></i> |
| 3373 | </div> |
| 3374 | <div class="swiper-button-prev swiper-button-prev-<?php echo esc_attr( $this->get_id() ); ?>"> |
| 3375 | <i class="<?php echo esc_attr( $pa_prev_arrow ); ?>"></i> |
| 3376 | </div> |
| 3377 | <?php |
| 3378 | } |
| 3379 | } |
| 3380 | |
| 3381 | /** |
| 3382 | * Build proper query to fetch product data from wp query |
| 3383 | * @return array |
| 3384 | */ |
| 3385 | public function product_query_builder(){ |
| 3386 | $settings = $this->get_settings_for_display(); |
| 3387 | $widget_id = esc_attr( $this->get_id() ); |
| 3388 | $settings[ 'eael_widget_id' ] = $widget_id; |
| 3389 | $order_by = $settings[ 'orderby' ]; |
| 3390 | $filter = $settings[ 'eael_product_carousel_product_filter' ]; |
| 3391 | $args = [ |
| 3392 | 'post_type' => 'product', |
| 3393 | 'post_status' => !empty( $settings['eael_product_carousel_products_status'] ) ? $settings['eael_product_carousel_products_status'] : ['publish'], |
| 3394 | 'posts_per_page' => $settings[ 'eael_product_carousel_products_count' ] ?: 4, |
| 3395 | 'order' => $settings[ 'order' ], |
| 3396 | 'offset' => $settings[ 'product_offset' ], |
| 3397 | 'post__not_in' => array( get_the_ID() ), |
| 3398 | 'tax_query' => [ |
| 3399 | 'relation' => 'AND', |
| 3400 | [ |
| 3401 | 'taxonomy' => 'product_visibility', |
| 3402 | 'field' => 'name', |
| 3403 | 'terms' => [ 'exclude-from-search', 'exclude-from-catalog' ], |
| 3404 | 'operator' => 'NOT IN', |
| 3405 | ], |
| 3406 | ], |
| 3407 | ]; |
| 3408 | |
| 3409 | if ( $order_by == '_price' || $order_by == '_sku' ) { |
| 3410 | $args[ 'orderby' ] = 'meta_value meta_value_num'; |
| 3411 | $args[ 'meta_key' ] = $order_by; |
| 3412 | } else { |
| 3413 | $args[ 'orderby' ] = $order_by; |
| 3414 | } |
| 3415 | |
| 3416 | if ( $filter == 'featured-products' ) { |
| 3417 | $count = isset( $args[ 'tax_query' ] ) ? count( $args[ 'tax_query' ] ) : 0; |
| 3418 | $args[ 'tax_query' ][ $count ] = |
| 3419 | [ |
| 3420 | 'taxonomy' => 'product_visibility', |
| 3421 | 'field' => 'name', |
| 3422 | 'terms' => 'featured', |
| 3423 | ]; |
| 3424 | } |
| 3425 | |
| 3426 | if ( $filter == 'best-selling-products' ) { |
| 3427 | $args[ 'meta_key' ] = 'total_sales'; |
| 3428 | $args[ 'orderby' ] = 'meta_value_num'; |
| 3429 | $args[ 'order' ] = 'DESC'; |
| 3430 | } |
| 3431 | |
| 3432 | if ( $filter == 'top-products' ) { |
| 3433 | $args[ 'meta_key' ] = '_wc_average_rating'; |
| 3434 | $args[ 'orderby' ] = 'meta_value_num'; |
| 3435 | $args[ 'order' ] = 'DESC'; |
| 3436 | } |
| 3437 | |
| 3438 | if ( $filter == 'related-products' ) { |
| 3439 | $current_product_id = get_the_ID(); |
| 3440 | $product_categories = wp_get_post_terms( $current_product_id, 'product_cat', array( 'fields' => 'ids' ) ); |
| 3441 | $product_tags = wp_get_post_terms( $current_product_id, 'product_tag', array('fields' => 'names' ) ); |
| 3442 | $args['tax_query'] = array( |
| 3443 | 'relation' => 'OR', |
| 3444 | array( |
| 3445 | 'taxonomy' => 'product_cat', |
| 3446 | 'field' => 'term_id', |
| 3447 | 'terms' => $product_categories, |
| 3448 | 'operator' => 'IN', |
| 3449 | ), |
| 3450 | array( |
| 3451 | 'taxonomy' => 'product_tag', |
| 3452 | 'field' => 'name', |
| 3453 | 'terms' => $product_tags, |
| 3454 | 'operator' => 'IN', |
| 3455 | ), |
| 3456 | ); |
| 3457 | } |
| 3458 | |
| 3459 | if ( get_option( 'woocommerce_hide_out_of_stock_items' ) == 'yes' ) { |
| 3460 | $args[ 'meta_query' ] = [ 'relation' => 'AND' ]; |
| 3461 | $args[ 'meta_query' ][] = [ |
| 3462 | 'key' => '_stock_status', |
| 3463 | 'value' => 'instock' |
| 3464 | ]; |
| 3465 | } |
| 3466 | |
| 3467 | if ( $filter == 'sale-products' ) { |
| 3468 | $args['post__in'] = array_merge( [ 0 ], wc_get_product_ids_on_sale() ); |
| 3469 | } |
| 3470 | |
| 3471 | if ( $filter == 'manual' ) { |
| 3472 | $args['post__in'] = ! empty( $settings['eael_product_carousel_products_in'] ) ? $settings['eael_product_carousel_products_in'] : [ 0 ]; |
| 3473 | } |
| 3474 | |
| 3475 | |
| 3476 | $taxonomies = get_taxonomies( [ 'object_type' => [ 'product' ] ], 'objects' ); |
| 3477 | $tax_query_count = isset( $args[ 'meta_query' ] ) ? count( $args[ 'meta_query' ] ) : 0; |
| 3478 | foreach ( $taxonomies as $object ) { |
| 3479 | $setting_key = $object->name . '_ids'; |
| 3480 | if ( !empty( $settings[ $setting_key ] ) ) { |
| 3481 | $args[ 'tax_query' ][ $tax_query_count ] = [ |
| 3482 | 'taxonomy' => $object->name, |
| 3483 | 'field' => 'term_id', |
| 3484 | 'terms' => $settings[ $setting_key ], |
| 3485 | ]; |
| 3486 | } |
| 3487 | $tax_query_count++; |
| 3488 | } |
| 3489 | |
| 3490 | return $args; |
| 3491 | } |
| 3492 | |
| 3493 | public function load_quick_view_asset(){ |
| 3494 | add_action('wp_footer',function (){ |
| 3495 | if ( version_compare( WC()->version, '3.0.0', '>=' ) ) { |
| 3496 | if ( current_theme_supports( 'wc-product-gallery-zoom' ) ) { |
| 3497 | wp_enqueue_script( 'zoom' ); |
| 3498 | } |
| 3499 | if ( current_theme_supports( 'wc-product-gallery-slider' ) ) { |
| 3500 | wp_enqueue_script( 'flexslider' ); |
| 3501 | } |
| 3502 | if ( current_theme_supports( 'wc-product-gallery-lightbox' ) ) { |
| 3503 | wp_enqueue_script( 'photoswipe-ui-default' ); |
| 3504 | wp_enqueue_style( 'photoswipe-default-skin' ); |
| 3505 | if ( has_action( 'wp_footer', 'woocommerce_photoswipe' ) === false ) { |
| 3506 | add_action( 'wp_footer', 'woocommerce_photoswipe', 15 ); |
| 3507 | } |
| 3508 | } |
| 3509 | wp_enqueue_script( 'wc-add-to-cart-variation' ); |
| 3510 | wp_enqueue_script( 'wc-single-product' ); |
| 3511 | } |
| 3512 | }); |
| 3513 | } |
| 3514 | } |
| 3515 |