| 1 |
<?php |
| 2 |
namespace Easyel\EasyElements\Widgets; |
| 3 |
use Elementor\Controls_Manager; |
| 4 |
use Elementor\Widget_Base; |
| 5 |
use Elementor\Icons_Manager; |
| 6 |
use Elementor\Group_Control_Background; |
| 7 |
use Elementor\Group_Control_Border; |
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
class Easyel_Pricing_Table_Widget extends \Elementor\Widget_Base { |
| 13 |
|
| 14 |
public function get_name() { |
| 15 |
return 'eel-pricing'; |
| 16 |
} |
| 17 |
|
| 18 |
public function get_title() { |
| 19 |
return __( 'Pricing Table', 'easy-elements' ); |
| 20 |
} |
| 21 |
|
| 22 |
public function get_icon() { |
| 23 |
return 'easyicon easyelIcon-pricing-table'; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_categories() { |
| 27 |
return [ 'easyelements_category' ]; |
| 28 |
} |
| 29 |
public function get_keywords() { |
| 30 |
return [ 'pricing', 'pricing-table', 'table', 'text' ]; |
| 31 |
} |
| 32 |
|
| 33 |
public function get_style_depends() { |
| 34 |
return [ |
| 35 |
'eel-pricing', |
| 36 |
]; |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
protected function register_controls() { |
| 41 |
$this->start_controls_section('section_settings', [ |
| 42 |
'label' => __('Pricing Settings', 'easy-elements'), |
| 43 |
]); |
| 44 |
|
| 45 |
$this->add_control('skin_style', [ |
| 46 |
'label' => __('Pricing Skin', 'easy-elements'), |
| 47 |
'type' => Controls_Manager::SELECT, |
| 48 |
'options' => [ |
| 49 |
'skin1' => 'Skin 01', |
| 50 |
'skin2' => 'Skin 02', |
| 51 |
], |
| 52 |
'default' => 'skin1', |
| 53 |
]); |
| 54 |
|
| 55 |
$this->end_controls_section(); |
| 56 |
|
| 57 |
// Title & Price |
| 58 |
$this->start_controls_section('section_title_price', [ |
| 59 |
'label' => __('Title & Price Settings', 'easy-elements'), |
| 60 |
]); |
| 61 |
$this->add_control('title', [ |
| 62 |
'label' => __('Title', 'easy-elements'), |
| 63 |
'type' => Controls_Manager::TEXT, |
| 64 |
'default' => 'Basic Plan', |
| 65 |
'dynamic' => [ |
| 66 |
'active' => true, |
| 67 |
], |
| 68 |
]); |
| 69 |
|
| 70 |
$this->add_control('description', [ |
| 71 |
'label' => __('Description', 'easy-elements'), |
| 72 |
'type' => Controls_Manager::TEXT, |
| 73 |
'default' => '', |
| 74 |
'dynamic' => [ |
| 75 |
'active' => true, |
| 76 |
], |
| 77 |
]); |
| 78 |
|
| 79 |
// On Sale Switcher |
| 80 |
$this->add_control('on_sale', [ |
| 81 |
'label' => __('On Sale?', 'easy-elements'), |
| 82 |
'type' => Controls_Manager::SWITCHER, |
| 83 |
'label_on' => __('Yes', 'easy-elements'), |
| 84 |
'label_off' => __('No', 'easy-elements'), |
| 85 |
'return_value' => 'yes', |
| 86 |
'default' => '', |
| 87 |
]); |
| 88 |
|
| 89 |
// Regular Price - visible only if On Sale = yes |
| 90 |
$this->add_control('regular_price', [ |
| 91 |
'label' => __('Regular Price', 'easy-elements'), |
| 92 |
'type' => Controls_Manager::TEXT, |
| 93 |
'default' => '59', |
| 94 |
'dynamic' => [ |
| 95 |
'active' => true, |
| 96 |
], |
| 97 |
'condition' => [ |
| 98 |
'on_sale' => 'yes', |
| 99 |
], |
| 100 |
]); |
| 101 |
|
| 102 |
// Sale Price - visible only if On Sale = yes |
| 103 |
$this->add_control('sale_price', [ |
| 104 |
'label' => __('Sale Price', 'easy-elements'), |
| 105 |
'type' => Controls_Manager::TEXT, |
| 106 |
'default' => '49', |
| 107 |
'dynamic' => [ |
| 108 |
'active' => true, |
| 109 |
], |
| 110 |
'condition' => [ |
| 111 |
'on_sale' => 'yes', |
| 112 |
], |
| 113 |
]); |
| 114 |
|
| 115 |
// Price (used if On Sale = no) |
| 116 |
$this->add_control('price', [ |
| 117 |
'label' => __('Price', 'easy-elements'), |
| 118 |
'type' => Controls_Manager::TEXT, |
| 119 |
'default' => '59', |
| 120 |
'dynamic' => [ |
| 121 |
'active' => true, |
| 122 |
], |
| 123 |
'condition' => [ |
| 124 |
'on_sale!' => 'yes', |
| 125 |
], |
| 126 |
]); |
| 127 |
|
| 128 |
$this->add_control('price_currency', [ |
| 129 |
'label' => __('Currency', 'easy-elements'), |
| 130 |
'type' => Controls_Manager::TEXT, |
| 131 |
'default' => '$', |
| 132 |
'dynamic' => [ |
| 133 |
'active' => true, |
| 134 |
], |
| 135 |
]); |
| 136 |
$this->add_control('currency_placement', [ |
| 137 |
'label' => __('Currency Position', 'easy-elements'), |
| 138 |
'type' => \Elementor\Controls_Manager::CHOOSE, |
| 139 |
'default' => 'left', |
| 140 |
'options' => [ |
| 141 |
'left' => [ |
| 142 |
'title' => __('Left', 'easy-elements'), |
| 143 |
'icon' => 'eicon-h-align-left', |
| 144 |
], |
| 145 |
'right' => [ |
| 146 |
'title' => __('Right', 'easy-elements'), |
| 147 |
'icon' => 'eicon-h-align-right', |
| 148 |
], |
| 149 |
], |
| 150 |
'toggle' => false, |
| 151 |
]); |
| 152 |
$this->add_control('price_period', [ |
| 153 |
'label' => __('Period', 'easy-elements'), |
| 154 |
'type' => Controls_Manager::TEXT, |
| 155 |
'default' => 'month', |
| 156 |
'dynamic' => [ |
| 157 |
'active' => true, |
| 158 |
], |
| 159 |
]); |
| 160 |
$this->add_control('period_separator', [ |
| 161 |
'label' => __('Separator', 'easy-elements'), |
| 162 |
'type' => Controls_Manager::TEXT, |
| 163 |
'default' => '/', |
| 164 |
'dynamic' => [ |
| 165 |
'active' => true, |
| 166 |
], |
| 167 |
]); |
| 168 |
|
| 169 |
$this->add_responsive_control('header_alignment', [ |
| 170 |
'label' => __('Alignment', 'easy-elements'), |
| 171 |
'type' => \Elementor\Controls_Manager::CHOOSE, |
| 172 |
'options' => [ |
| 173 |
'left' => [ |
| 174 |
'title' => __('Left', 'easy-elements'), |
| 175 |
'icon' => 'eicon-text-align-left', |
| 176 |
], |
| 177 |
'center' => [ |
| 178 |
'title' => __('Center', 'easy-elements'), |
| 179 |
'icon' => 'eicon-text-align-center', |
| 180 |
], |
| 181 |
'right' => [ |
| 182 |
'title' => __('Right', 'easy-elements'), |
| 183 |
'icon' => 'eicon-text-align-right', |
| 184 |
], |
| 185 |
], |
| 186 |
'default' => 'left', |
| 187 |
'toggle' => true, |
| 188 |
'selectors' => [ |
| 189 |
'{{WRAPPER}} .eel-price-title, {{WRAPPER}} .eel-price, {{WRAPPER}} .eel-subtitle-price' => 'text-align: {{VALUE}};', |
| 190 |
], |
| 191 |
]); |
| 192 |
|
| 193 |
$this->end_controls_section(); |
| 194 |
|
| 195 |
// Features |
| 196 |
$this->start_controls_section('section_features', [ |
| 197 |
'label' => __('Features Settings', 'easy-elements'), |
| 198 |
]); |
| 199 |
$this->add_control( |
| 200 |
'features_des', |
| 201 |
[ |
| 202 |
'label' => esc_html__( 'Features Description On Top', 'easy-elements' ), |
| 203 |
'type' => \Elementor\Controls_Manager::TEXTAREA, |
| 204 |
'placeholder' => esc_html__( 'Enter features description', 'easy-elements' ), |
| 205 |
] |
| 206 |
); |
| 207 |
$this->add_control('features_list', [ |
| 208 |
'label' => __('Features', 'easy-elements'), |
| 209 |
'type' => Controls_Manager::REPEATER, |
| 210 |
'fields' => [ |
| 211 |
[ |
| 212 |
'name' => 'icon', |
| 213 |
'label' => __('Icon', 'easy-elements'), |
| 214 |
'type' => Controls_Manager::ICONS, |
| 215 |
], |
| 216 |
[ |
| 217 |
'name' => 'text', |
| 218 |
'label' => __('Text', 'easy-elements'), |
| 219 |
'type' => Controls_Manager::TEXT, |
| 220 |
'default' => '99.9% Uptime Guarantee', |
| 221 |
'dynamic' => [ |
| 222 |
'active' => true, |
| 223 |
], |
| 224 |
], |
| 225 |
], |
| 226 |
'default' => [ |
| 227 |
[ |
| 228 |
'text' => '99.9% Uptime Guarantee', |
| 229 |
], |
| 230 |
[ |
| 231 |
'text' => 'Free SSL Certificate', |
| 232 |
], |
| 233 |
[ |
| 234 |
'text' => '24/7 Expert Support', |
| 235 |
], |
| 236 |
[ |
| 237 |
'text' => 'One-Click WordPress Install', |
| 238 |
], |
| 239 |
[ |
| 240 |
'text' => 'Unlimited Bandwidth', |
| 241 |
], |
| 242 |
[ |
| 243 |
'text' => 'SSD Storage', |
| 244 |
], |
| 245 |
[ |
| 246 |
'text' => 'Free Daily Backups', |
| 247 |
], |
| 248 |
[ |
| 249 |
'text' => 'Enhanced Security', |
| 250 |
], |
| 251 |
], |
| 252 |
]); |
| 253 |
|
| 254 |
$this->add_control('feature_icon_style', [ |
| 255 |
'label' => __('Icon Style', 'easy-elements'), |
| 256 |
'type' => Controls_Manager::SELECT, |
| 257 |
'options' => [ |
| 258 |
'icon-only' => __('Icon Only', 'easy-elements'), |
| 259 |
'icon-bg' => __('Icon with Background', 'easy-elements'), |
| 260 |
'icon-border' => __('Icon with Border', 'easy-elements'), |
| 261 |
], |
| 262 |
'default' => 'icon-only', |
| 263 |
]); |
| 264 |
|
| 265 |
$this->add_group_control( |
| 266 |
Group_Control_Background::get_type(), |
| 267 |
[ |
| 268 |
'name' => 'feature_icon_bg', |
| 269 |
'label' => __('Icon Background', 'easy-elements'), |
| 270 |
'types' => ['classic', 'gradient'], |
| 271 |
'selector' => '{{WRAPPER}} .eel-features .feature-icon.icon-bg', |
| 272 |
'condition' => [ |
| 273 |
'feature_icon_style' => 'icon-bg', |
| 274 |
], |
| 275 |
] |
| 276 |
); |
| 277 |
|
| 278 |
$this->add_group_control( |
| 279 |
Group_Control_Border::get_type(), |
| 280 |
[ |
| 281 |
'name' => 'feature_icon_border', |
| 282 |
'label' => __('Icon Border', 'easy-elements'), |
| 283 |
'condition' => ['feature_icon_style' => 'icon-border'], |
| 284 |
'selector' => '{{WRAPPER}} .eel-features .feature-icon.icon-border', |
| 285 |
] |
| 286 |
); |
| 287 |
|
| 288 |
$this->add_control('feature_icon_color', [ |
| 289 |
'label' => __('Icon Color', 'easy-elements'), |
| 290 |
'type' => Controls_Manager::COLOR, |
| 291 |
'condition' => [ |
| 292 |
'feature_icon_style!' => '', |
| 293 |
], |
| 294 |
'selectors' => [ |
| 295 |
'{{WRAPPER}} .eel-features .feature-icon' => 'color: {{VALUE}};', |
| 296 |
'{{WRAPPER}} .eel-features .feature-icon svg path' => 'fill: {{VALUE}};', |
| 297 |
'{{WRAPPER}} .eel-features .icon-only svg path' => 'fill: {{VALUE}};', |
| 298 |
'{{WRAPPER}} .eel-features .icon-only i' => 'color: {{VALUE}};', |
| 299 |
'{{WRAPPER}} .eel-features .icon-bg svg path' => 'fill: {{VALUE}};', |
| 300 |
], |
| 301 |
]); |
| 302 |
|
| 303 |
$this->add_control('feature_icon_size', [ |
| 304 |
'label' => __('Icon Size (px)', 'easy-elements'), |
| 305 |
'type' => \Elementor\Controls_Manager::SLIDER, |
| 306 |
'size_units' => ['px'], |
| 307 |
'range' => [ |
| 308 |
'px' => [ |
| 309 |
'min' => 8, |
| 310 |
'max' => 64, |
| 311 |
'step' => 1, |
| 312 |
], |
| 313 |
], |
| 314 |
'selectors' => [ |
| 315 |
'{{WRAPPER}} .eel-features svg.feature-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', |
| 316 |
'{{WRAPPER}} .eel-features i.feature-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 317 |
], |
| 318 |
]); |
| 319 |
|
| 320 |
$this->add_responsive_control('feature_icon_padding', [ |
| 321 |
'label' => __('Icon Padding', 'easy-elements'), |
| 322 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 323 |
'size_units' => ['px', '%', 'em'], |
| 324 |
'condition' => [ |
| 325 |
'feature_icon_style' => ['icon-border', 'icon-bg'], |
| 326 |
], |
| 327 |
'selectors' => [ |
| 328 |
'{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 329 |
'{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 330 |
], |
| 331 |
]); |
| 332 |
|
| 333 |
$this->add_responsive_control('feature_icon_border_radius', [ |
| 334 |
'label' => __('Icon Border Radius', 'easy-elements'), |
| 335 |
'type' => Controls_Manager::DIMENSIONS, |
| 336 |
'size_units' => ['px', '%'], |
| 337 |
'condition' => [ |
| 338 |
'feature_icon_style' => ['icon-border', 'icon-bg'], |
| 339 |
], |
| 340 |
'selectors' => [ |
| 341 |
'{{WRAPPER}} .eel-features .feature-icon.icon-border' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 342 |
'{{WRAPPER}} .eel-features .feature-icon.icon-bg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 343 |
], |
| 344 |
]); |
| 345 |
|
| 346 |
$this->add_responsive_control('feature_text_alignment', [ |
| 347 |
'label' => __('Alignment', 'easy-elements'), |
| 348 |
'type' => \Elementor\Controls_Manager::CHOOSE, |
| 349 |
'options' => [ |
| 350 |
'left' => [ |
| 351 |
'title' => __('Left', 'easy-elements'), |
| 352 |
'icon' => 'eicon-text-align-left', |
| 353 |
], |
| 354 |
'center' => [ |
| 355 |
'title' => __('Center', 'easy-elements'), |
| 356 |
'icon' => 'eicon-text-align-center', |
| 357 |
], |
| 358 |
'right' => [ |
| 359 |
'title' => __('Right', 'easy-elements'), |
| 360 |
'icon' => 'eicon-text-align-right', |
| 361 |
], |
| 362 |
], |
| 363 |
'default' => 'left', |
| 364 |
'toggle' => true, |
| 365 |
'selectors' => [ |
| 366 |
'{{WRAPPER}} ul.eel-features' => 'text-align: {{VALUE}};', |
| 367 |
], |
| 368 |
]); |
| 369 |
|
| 370 |
$this->end_controls_section(); |
| 371 |
|
| 372 |
$this->start_controls_section('section_ribbon', [ |
| 373 |
'label' => __('Featured Settings', 'easy-elements'), |
| 374 |
]); |
| 375 |
$this->add_control('is_featured', [ |
| 376 |
'label' => __('Featured', 'easy-elements'), |
| 377 |
'type' => Controls_Manager::SWITCHER, |
| 378 |
'return_value' => 'yes', |
| 379 |
]); |
| 380 |
$this->add_control('ribbon_style', [ |
| 381 |
'label' => __('Ribbon Style', 'easy-elements'), |
| 382 |
'type' => Controls_Manager::SELECT, |
| 383 |
'options' => [ |
| 384 |
'style1' => 'Style 1', |
| 385 |
'style2' => 'Style 2', |
| 386 |
], |
| 387 |
'default' => 'style1', |
| 388 |
]); |
| 389 |
$this->add_control('featured_tag_text', [ |
| 390 |
'label' => __('Featured Text', 'easy-elements'), |
| 391 |
'type' => Controls_Manager::TEXT, |
| 392 |
'default' => 'Featured', |
| 393 |
'dynamic' => [ |
| 394 |
'active' => true, |
| 395 |
], |
| 396 |
]); |
| 397 |
$this->add_control('ribbon_alignment', [ |
| 398 |
'label' => __('Alignment', 'easy-elements'), |
| 399 |
'type' => Controls_Manager::SELECT, |
| 400 |
'options' => [ 'left' => 'Left', 'right' => 'Right' ], |
| 401 |
'default' => 'right', |
| 402 |
'condition' => [ |
| 403 |
'ribbon_style' => 'style2', |
| 404 |
], |
| 405 |
]); |
| 406 |
|
| 407 |
$this->add_control( |
| 408 |
'featured__text_color', |
| 409 |
[ |
| 410 |
'label' => __('Text Color', 'easy-elements'), |
| 411 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 412 |
'selectors' => [ |
| 413 |
'{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon' => 'color: {{VALUE}};', |
| 414 |
], |
| 415 |
] |
| 416 |
); |
| 417 |
|
| 418 |
$this->add_group_control( |
| 419 |
Group_Control_Background::get_type(), |
| 420 |
[ |
| 421 |
'name' => 'featured__bg', |
| 422 |
'label' => __('Background', 'easy-elements'), |
| 423 |
'types' => ['classic', 'gradient'], |
| 424 |
'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon', |
| 425 |
] |
| 426 |
); |
| 427 |
|
| 428 |
$this->add_group_control( |
| 429 |
\Elementor\Group_Control_Typography::get_type(), |
| 430 |
[ |
| 431 |
'name' => 'featured__typography', |
| 432 |
'label' => __('Typography', 'easy-elements'), |
| 433 |
'selector' => '{{WRAPPER}} .featured.style2 .eel-ribbon, {{WRAPPER}} .eel-ribbon', |
| 434 |
] |
| 435 |
); |
| 436 |
|
| 437 |
$this->add_responsive_control( |
| 438 |
'fea_box_padding', |
| 439 |
[ |
| 440 |
'label' => __('Padding', 'easy-elements'), |
| 441 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 442 |
'size_units' => ['px', '%', 'em'], |
| 443 |
'selectors' => [ |
| 444 |
'{{WRAPPER}} .eel-ribbon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 445 |
], |
| 446 |
'condition' => [ |
| 447 |
'ribbon_style' => 'style1', |
| 448 |
], |
| 449 |
] |
| 450 |
); |
| 451 |
|
| 452 |
$this->add_responsive_control( |
| 453 |
'fea_box_border_radius', |
| 454 |
[ |
| 455 |
'label' => __('Border Radius', 'easy-elements'), |
| 456 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 457 |
'size_units' => ['px', '%'], |
| 458 |
'selectors' => [ |
| 459 |
'{{WRAPPER}} .eel-ribbon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 460 |
], |
| 461 |
'condition' => [ |
| 462 |
'ribbon_style' => 'style1', |
| 463 |
], |
| 464 |
] |
| 465 |
); |
| 466 |
|
| 467 |
$this->end_controls_section(); |
| 468 |
|
| 469 |
// Button |
| 470 |
$this->start_controls_section('section_button', [ |
| 471 |
'label' => __('Button Settings', 'easy-elements'), |
| 472 |
]); |
| 473 |
$this->add_control('show_button', [ |
| 474 |
'label' => __('Show Button', 'easy-elements'), |
| 475 |
'type' => Controls_Manager::SWITCHER, |
| 476 |
'return_value' => 'yes', |
| 477 |
'default' => 'yes', |
| 478 |
]); |
| 479 |
$this->add_control('button_text', [ |
| 480 |
'label' => __('Text', 'easy-elements'), |
| 481 |
'type' => Controls_Manager::TEXT, |
| 482 |
'default' => 'Choose Plan', |
| 483 |
'dynamic' => [ |
| 484 |
'active' => true, |
| 485 |
], |
| 486 |
]); |
| 487 |
|
| 488 |
$this->add_control('button_subtext', [ |
| 489 |
'label' => __('Bottom Text', 'easy-elements'), |
| 490 |
'type' => Controls_Manager::TEXT, |
| 491 |
'default' => 'No credit card required!', |
| 492 |
'placeholder' => __('Enter subtext below button', 'easy-elements'), |
| 493 |
'dynamic' => [ |
| 494 |
'active' => true, |
| 495 |
], |
| 496 |
]); |
| 497 |
|
| 498 |
$this->add_control('button_link', [ |
| 499 |
'label' => __('Link', 'easy-elements'), |
| 500 |
'type' => Controls_Manager::URL, |
| 501 |
'default' => [ 'url' => '#' ], |
| 502 |
'dynamic' => [ |
| 503 |
'active' => true, |
| 504 |
], |
| 505 |
]); |
| 506 |
$this->add_control('button_icon', [ |
| 507 |
'label' => __('Icon', 'easy-elements'), |
| 508 |
'type' => Controls_Manager::ICONS, |
| 509 |
'default' => [ 'value' => '', 'library' => 'solid' ], |
| 510 |
]); |
| 511 |
$this->add_control('button_icon_position', [ |
| 512 |
'label' => __('Icon Position', 'easy-elements'), |
| 513 |
'type' => Controls_Manager::SELECT, |
| 514 |
'options' => [ 'before' => 'Before', 'after' => 'After' ], |
| 515 |
'default' => 'after', |
| 516 |
]); |
| 517 |
$this->add_responsive_control('button_icon_spacing', [ |
| 518 |
'label' => __('Icon Spacing', 'easy-elements'), |
| 519 |
'type' => Controls_Manager::SLIDER, |
| 520 |
'range' => [ |
| 521 |
'px' => ['min' => 0, 'max' => 50], |
| 522 |
], |
| 523 |
'default' => [], |
| 524 |
'selectors' => [ |
| 525 |
'{{WRAPPER}} .eel-button .eel-icon-before' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 526 |
'{{WRAPPER}} .eel-button .eel-icon-after' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 527 |
], |
| 528 |
]); |
| 529 |
|
| 530 |
$this->add_responsive_control('button_icon_spacing_vertical', [ |
| 531 |
'label' => __('Icon Vertical Spacing', 'easy-elements'), |
| 532 |
'type' => \Elementor\Controls_Manager::SLIDER, |
| 533 |
'range' => [ |
| 534 |
'px' => ['min' => 0, 'max' => 60], |
| 535 |
], |
| 536 |
'selectors' => [ |
| 537 |
'{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'top: {{SIZE}}{{UNIT}}; position:relative;', |
| 538 |
], |
| 539 |
]); |
| 540 |
|
| 541 |
$this->add_control('button_position', [ |
| 542 |
'label' => __('Button Position', 'easy-elements'), |
| 543 |
'type' => Controls_Manager::SELECT, |
| 544 |
'options' => [ |
| 545 |
'after_features' => __('After Features', 'easy-elements'), |
| 546 |
'in_features' => __('Before Features', 'easy-elements'), |
| 547 |
], |
| 548 |
'default' => 'after_features', |
| 549 |
]); |
| 550 |
|
| 551 |
$this->add_responsive_control('btn_alignment', [ |
| 552 |
'label' => __('Alignment', 'easy-elements'), |
| 553 |
'type' => \Elementor\Controls_Manager::CHOOSE, |
| 554 |
'options' => [ |
| 555 |
'left' => [ |
| 556 |
'title' => __('Left', 'easy-elements'), |
| 557 |
'icon' => 'eicon-text-align-left', |
| 558 |
], |
| 559 |
'center' => [ |
| 560 |
'title' => __('Center', 'easy-elements'), |
| 561 |
'icon' => 'eicon-text-align-center', |
| 562 |
], |
| 563 |
'right' => [ |
| 564 |
'title' => __('Right', 'easy-elements'), |
| 565 |
'icon' => 'eicon-text-align-right', |
| 566 |
], |
| 567 |
], |
| 568 |
'default' => 'left', |
| 569 |
'toggle' => true, |
| 570 |
'selectors' => [ |
| 571 |
'{{WRAPPER}} .eel-btn-part' => 'text-align: {{VALUE}};', |
| 572 |
], |
| 573 |
]); |
| 574 |
|
| 575 |
$this->add_control('button_full_width', [ |
| 576 |
'label' => __('Enable Full Button Width', 'easy-elements'), |
| 577 |
'type' => \Elementor\Controls_Manager::SWITCHER, |
| 578 |
'label_on' => __('Yes', 'easy-elements'), |
| 579 |
'label_off' => __('No', 'easy-elements'), |
| 580 |
'return_value' => 'yes', |
| 581 |
'default' => '', |
| 582 |
]); |
| 583 |
|
| 584 |
$this->end_controls_section(); |
| 585 |
|
| 586 |
// Start Style Tab Section |
| 587 |
$this->start_controls_section( |
| 588 |
'section_style_title_price', |
| 589 |
[ |
| 590 |
'label' => __('Title & Price Style', 'easy-elements'), |
| 591 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 592 |
] |
| 593 |
); |
| 594 |
|
| 595 |
// Title Style |
| 596 |
$this->add_control( |
| 597 |
'title_heading', |
| 598 |
[ |
| 599 |
'label' => __('Title', 'easy-elements'), |
| 600 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 601 |
'separator' => 'before', |
| 602 |
] |
| 603 |
); |
| 604 |
$this->add_control( |
| 605 |
'title_color', |
| 606 |
[ |
| 607 |
'label' => __('Title Color', 'easy-elements'), |
| 608 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 609 |
'selectors' => [ |
| 610 |
'{{WRAPPER}} .eel-price-title' => 'color: {{VALUE}};', |
| 611 |
], |
| 612 |
] |
| 613 |
); |
| 614 |
$this->add_control( |
| 615 |
'title_hilight_color', |
| 616 |
[ |
| 617 |
'label' => __('Highlight Color', 'easy-elements'), |
| 618 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 619 |
'selectors' => [ |
| 620 |
'{{WRAPPER}} .eel-price-title span' => 'color: {{VALUE}};', |
| 621 |
], |
| 622 |
] |
| 623 |
); |
| 624 |
$this->add_group_control( |
| 625 |
\Elementor\Group_Control_Typography::get_type(), |
| 626 |
[ |
| 627 |
'name' => 'title_typography', |
| 628 |
'selector' => '{{WRAPPER}} .eel-price-title', |
| 629 |
] |
| 630 |
); |
| 631 |
|
| 632 |
$this->add_control( |
| 633 |
'title_bg_color', |
| 634 |
[ |
| 635 |
'label' => __('Background Color', 'easy-elements'), |
| 636 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 637 |
'selectors' => [ |
| 638 |
'{{WRAPPER}} .eel-price-title' => 'background-color: {{VALUE}};', |
| 639 |
], |
| 640 |
] |
| 641 |
); |
| 642 |
$this->add_group_control( |
| 643 |
\Elementor\Group_Control_Border::get_type(), |
| 644 |
[ |
| 645 |
'name' => 'title_border', |
| 646 |
'selector' => '{{WRAPPER}} .eel-price-title', |
| 647 |
] |
| 648 |
); |
| 649 |
$this->add_responsive_control( |
| 650 |
'title_border_radius', |
| 651 |
[ |
| 652 |
'label' => __('Border Radius', 'easy-elements'), |
| 653 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 654 |
'size_units' => ['px', '%'], |
| 655 |
'selectors' => [ |
| 656 |
'{{WRAPPER}} .eel-price-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 657 |
], |
| 658 |
] |
| 659 |
); |
| 660 |
$this->add_responsive_control( |
| 661 |
'title_padding', |
| 662 |
[ |
| 663 |
'label' => __('Padding', 'easy-elements'), |
| 664 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 665 |
'size_units' => ['px', 'em', '%'], |
| 666 |
'selectors' => [ |
| 667 |
'{{WRAPPER}} .eel-price-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 668 |
], |
| 669 |
] |
| 670 |
); |
| 671 |
$this->add_responsive_control( |
| 672 |
'title_margin', |
| 673 |
[ |
| 674 |
'label' => __('Margin', 'easy-elements'), |
| 675 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 676 |
'size_units' => ['px', 'em', '%'], |
| 677 |
'selectors' => [ |
| 678 |
'{{WRAPPER}} .eel-price-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 679 |
], |
| 680 |
] |
| 681 |
); |
| 682 |
|
| 683 |
// Title Style |
| 684 |
$this->add_control( |
| 685 |
'description_heading', |
| 686 |
[ |
| 687 |
'label' => __('Description', 'easy-elements'), |
| 688 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 689 |
'separator' => 'before', |
| 690 |
] |
| 691 |
); |
| 692 |
|
| 693 |
$this->add_control( |
| 694 |
'description_color', |
| 695 |
[ |
| 696 |
'label' => __('Description Color', 'easy-elements'), |
| 697 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 698 |
'selectors' => [ |
| 699 |
'{{WRAPPER}} .eel-subtitle-price' => 'color: {{VALUE}};', |
| 700 |
], |
| 701 |
] |
| 702 |
); |
| 703 |
$this->add_group_control( |
| 704 |
\Elementor\Group_Control_Typography::get_type(), |
| 705 |
[ |
| 706 |
'name' => 'description_typography', |
| 707 |
'selector' => '{{WRAPPER}} .eel-subtitle-price', |
| 708 |
] |
| 709 |
); |
| 710 |
|
| 711 |
$this->add_group_control( |
| 712 |
Group_Control_Border::get_type(), |
| 713 |
[ |
| 714 |
'name' => 'description_border', |
| 715 |
'label' => __('Icon Border', 'easy-elements'), |
| 716 |
'selector' => '{{WRAPPER}} .eel-subtitle-price', |
| 717 |
] |
| 718 |
); |
| 719 |
|
| 720 |
$this->add_responsive_control( |
| 721 |
'description_padding', |
| 722 |
[ |
| 723 |
'label' => __('Padding', 'easy-elements'), |
| 724 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 725 |
'size_units' => ['px', 'em', '%'], |
| 726 |
'selectors' => [ |
| 727 |
'{{WRAPPER}} .eel-subtitle-price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 728 |
], |
| 729 |
] |
| 730 |
); |
| 731 |
|
| 732 |
$this->add_responsive_control( |
| 733 |
'description_margin', |
| 734 |
[ |
| 735 |
'label' => __('Margin', 'easy-elements'), |
| 736 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 737 |
'size_units' => ['px', 'em', '%'], |
| 738 |
'selectors' => [ |
| 739 |
'{{WRAPPER}} .eel-subtitle-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 740 |
], |
| 741 |
] |
| 742 |
); |
| 743 |
|
| 744 |
// Regular Price Style |
| 745 |
$this->add_control( |
| 746 |
'price_heading', |
| 747 |
[ |
| 748 |
'label' => __('Price', 'easy-elements'), |
| 749 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 750 |
'separator' => 'before', |
| 751 |
] |
| 752 |
); |
| 753 |
$this->add_control( |
| 754 |
'price_color', |
| 755 |
[ |
| 756 |
'label' => __('Price Color', 'easy-elements'), |
| 757 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 758 |
'selectors' => [ |
| 759 |
'{{WRAPPER}} .eel-price .eel-amount' => 'color: {{VALUE}};', |
| 760 |
], |
| 761 |
] |
| 762 |
); |
| 763 |
$this->add_group_control( |
| 764 |
\Elementor\Group_Control_Typography::get_type(), |
| 765 |
[ |
| 766 |
'name' => 'price_typography', |
| 767 |
'selector' => '{{WRAPPER}} .eel-price .eel-amount', |
| 768 |
] |
| 769 |
); |
| 770 |
|
| 771 |
$this->add_responsive_control( |
| 772 |
'price__margin', |
| 773 |
[ |
| 774 |
'label' => __('Margin', 'easy-elements'), |
| 775 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 776 |
'size_units' => ['px', 'em', '%'], |
| 777 |
'selectors' => [ |
| 778 |
'{{WRAPPER}} .eel-price' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 779 |
], |
| 780 |
] |
| 781 |
); |
| 782 |
|
| 783 |
// Sale Price Del Style (optional) |
| 784 |
$this->add_control( |
| 785 |
'sale_price_heading', |
| 786 |
[ |
| 787 |
'label' => __('Regular (Sale) Price', 'easy-elements'), |
| 788 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 789 |
'separator' => 'before', |
| 790 |
'condition' => ['on_sale' => 'yes'], |
| 791 |
] |
| 792 |
); |
| 793 |
$this->add_control( |
| 794 |
'regular_price_color', |
| 795 |
[ |
| 796 |
'label' => __('Regular Price Color', 'easy-elements'), |
| 797 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 798 |
'selectors' => [ |
| 799 |
'{{WRAPPER}} .eel-sale-price' => 'color: {{VALUE}};', |
| 800 |
], |
| 801 |
'condition' => ['on_sale' => 'yes'], |
| 802 |
] |
| 803 |
); |
| 804 |
$this->add_group_control( |
| 805 |
\Elementor\Group_Control_Typography::get_type(), |
| 806 |
[ |
| 807 |
'name' => 'regular_price_typography', |
| 808 |
'selector' => '{{WRAPPER}} .eel-sale-price', |
| 809 |
'condition' => ['on_sale' => 'yes'], |
| 810 |
] |
| 811 |
); |
| 812 |
|
| 813 |
// Period Style |
| 814 |
$this->add_control( |
| 815 |
'period_heading', |
| 816 |
[ |
| 817 |
'label' => __('Period', 'easy-elements'), |
| 818 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 819 |
'separator' => 'before', |
| 820 |
] |
| 821 |
); |
| 822 |
$this->add_control( |
| 823 |
'period_color', |
| 824 |
[ |
| 825 |
'label' => __('Period Color', 'easy-elements'), |
| 826 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 827 |
'selectors' => [ |
| 828 |
'{{WRAPPER}} .eel-period' => 'color: {{VALUE}};', |
| 829 |
], |
| 830 |
] |
| 831 |
); |
| 832 |
$this->add_group_control( |
| 833 |
\Elementor\Group_Control_Typography::get_type(), |
| 834 |
[ |
| 835 |
'name' => 'period_typography', |
| 836 |
'selector' => '{{WRAPPER}} .eel-period', |
| 837 |
] |
| 838 |
); |
| 839 |
|
| 840 |
$this->add_responsive_control( |
| 841 |
'period_margin', |
| 842 |
[ |
| 843 |
'label' => __('Margin', 'easy-elements'), |
| 844 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 845 |
'size_units' => ['px', 'em', '%'], |
| 846 |
'selectors' => [ |
| 847 |
'{{WRAPPER}} .eel-price .eel-period' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 848 |
], |
| 849 |
] |
| 850 |
); |
| 851 |
|
| 852 |
$this->add_control( |
| 853 |
'currency_style_heading', |
| 854 |
[ |
| 855 |
'label' => __('Currency Symbol', 'easy-elements'), |
| 856 |
'type' => \Elementor\Controls_Manager::HEADING, |
| 857 |
'separator' => 'before', |
| 858 |
] |
| 859 |
); |
| 860 |
|
| 861 |
$this->add_control( |
| 862 |
'currency_symbol_color', |
| 863 |
[ |
| 864 |
'label' => __('Color', 'easy-elements'), |
| 865 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 866 |
'selectors' => [ |
| 867 |
'{{WRAPPER}} .eel-currency' => 'color: {{VALUE}};', |
| 868 |
], |
| 869 |
] |
| 870 |
); |
| 871 |
|
| 872 |
$this->add_group_control( |
| 873 |
\Elementor\Group_Control_Typography::get_type(), |
| 874 |
[ |
| 875 |
'name' => 'currency_symbol_typography', |
| 876 |
'selector' => '{{WRAPPER}} .eel-currency', |
| 877 |
] |
| 878 |
); |
| 879 |
|
| 880 |
$this->add_responsive_control( |
| 881 |
'currency_symbol_margin', |
| 882 |
[ |
| 883 |
'label' => __('Currency Margin', 'easy-elements'), |
| 884 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 885 |
'size_units' => ['px', 'em', '%'], |
| 886 |
'selectors' => [ |
| 887 |
'{{WRAPPER}} .eel-currency' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 888 |
], |
| 889 |
] |
| 890 |
); |
| 891 |
|
| 892 |
$this->add_responsive_control( |
| 893 |
'currency_symbol_vertical_position', |
| 894 |
[ |
| 895 |
'label' => __('Vertical Position', 'easy-elements'), |
| 896 |
'type' => \Elementor\Controls_Manager::SLIDER, |
| 897 |
'size_units' => ['px', '%'], |
| 898 |
'range' => [ |
| 899 |
'px' => [ |
| 900 |
'min' => -50, |
| 901 |
'max' => 50, |
| 902 |
], |
| 903 |
'%' => [ |
| 904 |
'min' => -100, |
| 905 |
'max' => 100, |
| 906 |
], |
| 907 |
], |
| 908 |
'selectors' => [ |
| 909 |
'{{WRAPPER}} .eel-currency' => 'display: inline-block; transform: translateY({{SIZE}}{{UNIT}});', |
| 910 |
], |
| 911 |
] |
| 912 |
); |
| 913 |
|
| 914 |
$this->end_controls_section(); |
| 915 |
|
| 916 |
$this->start_controls_section( |
| 917 |
'section_features_descqription_style', |
| 918 |
[ |
| 919 |
'label' => __('Features Description', 'easy-elements'), |
| 920 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 921 |
'condition' => [ |
| 922 |
'features_des!' => '', |
| 923 |
], |
| 924 |
] |
| 925 |
); |
| 926 |
|
| 927 |
$this->add_control( |
| 928 |
'features_des__text_color', |
| 929 |
[ |
| 930 |
'label' => __('Color', 'easy-elements'), |
| 931 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 932 |
'selectors' => [ |
| 933 |
'{{WRAPPER}} .eel-features-description' => 'color: {{VALUE}};', |
| 934 |
], |
| 935 |
] |
| 936 |
); |
| 937 |
|
| 938 |
// Text typography |
| 939 |
$this->add_group_control( |
| 940 |
\Elementor\Group_Control_Typography::get_type(), |
| 941 |
[ |
| 942 |
'name' => 'features_des__text__typography', |
| 943 |
'selector' => '{{WRAPPER}} .eel-features-description', |
| 944 |
] |
| 945 |
); |
| 946 |
|
| 947 |
$this->add_group_control( |
| 948 |
Group_Control_Border::get_type(), |
| 949 |
[ |
| 950 |
'name' => 'features_des_text_border', |
| 951 |
'label' => __('Border', 'easy-elements'), |
| 952 |
'selector' => '{{WRAPPER}} .eel-features-description', |
| 953 |
] |
| 954 |
); |
| 955 |
|
| 956 |
$this->add_responsive_control( |
| 957 |
'features_description_padding', |
| 958 |
[ |
| 959 |
'label' => __('Padding', 'easy-elements'), |
| 960 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 961 |
'size_units' => ['px', 'em', '%'], |
| 962 |
'selectors' => [ |
| 963 |
'{{WRAPPER}} .eel-features-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 964 |
], |
| 965 |
] |
| 966 |
); |
| 967 |
|
| 968 |
$this->add_responsive_control( |
| 969 |
'features_description_margin', |
| 970 |
[ |
| 971 |
'label' => __('Margin', 'easy-elements'), |
| 972 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 973 |
'size_units' => ['px', 'em', '%'], |
| 974 |
'selectors' => [ |
| 975 |
'{{WRAPPER}} .eel-features-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 976 |
], |
| 977 |
] |
| 978 |
); |
| 979 |
|
| 980 |
$this->end_controls_section(); |
| 981 |
|
| 982 |
$this->start_controls_section( |
| 983 |
'section_features_style', |
| 984 |
[ |
| 985 |
'label' => __('Features Style', 'easy-elements'), |
| 986 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 987 |
] |
| 988 |
); |
| 989 |
|
| 990 |
// Text color |
| 991 |
$this->add_control( |
| 992 |
'features_text_color', |
| 993 |
[ |
| 994 |
'label' => __('Text Color', 'easy-elements'), |
| 995 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 996 |
'selectors' => [ |
| 997 |
'{{WRAPPER}} .eel-features li' => 'color: {{VALUE}};', |
| 998 |
], |
| 999 |
] |
| 1000 |
); |
| 1001 |
|
| 1002 |
$this->add_control( |
| 1003 |
'features_icon_color', |
| 1004 |
[ |
| 1005 |
'label' => __('Icon Color', 'easy-elements'), |
| 1006 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1007 |
'selectors' => [ |
| 1008 |
'{{WRAPPER}} .eel-features li .feature-icon' => 'color: {{VALUE}};', |
| 1009 |
'{{WRAPPER}} .eel-features li svg path' => 'fill: {{VALUE}};', |
| 1010 |
], |
| 1011 |
] |
| 1012 |
); |
| 1013 |
|
| 1014 |
// Text typography |
| 1015 |
$this->add_group_control( |
| 1016 |
\Elementor\Group_Control_Typography::get_type(), |
| 1017 |
[ |
| 1018 |
'name' => 'features_text_typography', |
| 1019 |
'selector' => '{{WRAPPER}} .eel-features li', |
| 1020 |
] |
| 1021 |
); |
| 1022 |
|
| 1023 |
// Features list border |
| 1024 |
$this->add_group_control( |
| 1025 |
\Elementor\Group_Control_Border::get_type(), |
| 1026 |
[ |
| 1027 |
'name' => 'features_border', |
| 1028 |
'label' => __('Border', 'easy-elements'), |
| 1029 |
'selector' => '{{WRAPPER}} .eel-features li', |
| 1030 |
] |
| 1031 |
); |
| 1032 |
|
| 1033 |
// Features list padding |
| 1034 |
$this->add_responsive_control( |
| 1035 |
'features_padding', |
| 1036 |
[ |
| 1037 |
'label' => __('Padding', 'easy-elements'), |
| 1038 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1039 |
'size_units' => ['px', 'em', '%'], |
| 1040 |
'selectors' => [ |
| 1041 |
'{{WRAPPER}} .eel-features li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1042 |
], |
| 1043 |
] |
| 1044 |
); |
| 1045 |
|
| 1046 |
$this->add_responsive_control( |
| 1047 |
'features_icon_gap', |
| 1048 |
[ |
| 1049 |
'label' => __('Icon Gap', 'easy-elements'), |
| 1050 |
'type' => \Elementor\Controls_Manager::SLIDER, |
| 1051 |
'size_units' => ['px', 'em'], |
| 1052 |
'range' => [ |
| 1053 |
'px' => ['min' => 0, 'max' => 50], |
| 1054 |
], |
| 1055 |
'selectors' => [ |
| 1056 |
'{{WRAPPER}} .eel-features li' => 'display: flex; align-items: center; gap: {{SIZE}}{{UNIT}};', |
| 1057 |
], |
| 1058 |
] |
| 1059 |
); |
| 1060 |
|
| 1061 |
// Features list margin |
| 1062 |
$this->add_responsive_control( |
| 1063 |
'features_margin', |
| 1064 |
[ |
| 1065 |
'label' => __('Margin', 'easy-elements'), |
| 1066 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1067 |
'size_units' => ['px', 'em', '%'], |
| 1068 |
'selectors' => [ |
| 1069 |
'{{WRAPPER}} .eel-features li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1070 |
], |
| 1071 |
] |
| 1072 |
); |
| 1073 |
|
| 1074 |
$this->end_controls_section(); |
| 1075 |
|
| 1076 |
$this->start_controls_section( |
| 1077 |
'section_button_style', |
| 1078 |
[ |
| 1079 |
'label' => __('Button Style', 'easy-elements'), |
| 1080 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 1081 |
] |
| 1082 |
); |
| 1083 |
|
| 1084 |
$this->start_controls_tabs('button_style_tabs'); |
| 1085 |
|
| 1086 |
// Normal Tab |
| 1087 |
$this->start_controls_tab( |
| 1088 |
'button_style_normal', |
| 1089 |
[ |
| 1090 |
'label' => __('Normal', 'easy-elements'), |
| 1091 |
] |
| 1092 |
); |
| 1093 |
|
| 1094 |
// Normal Text Color |
| 1095 |
$this->add_control( |
| 1096 |
'button_text_color', |
| 1097 |
[ |
| 1098 |
'label' => __('Color', 'easy-elements'), |
| 1099 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1100 |
'selectors' => [ |
| 1101 |
'{{WRAPPER}} .eel-button' => 'color: {{VALUE}};', |
| 1102 |
], |
| 1103 |
] |
| 1104 |
); |
| 1105 |
|
| 1106 |
$this->add_control( |
| 1107 |
'button_icon_color', |
| 1108 |
[ |
| 1109 |
'label' => __('Icon Color', 'easy-elements'), |
| 1110 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1111 |
'selectors' => [ |
| 1112 |
'{{WRAPPER}} .eel-button .eel-icon-before, {{WRAPPER}} .eel-button .eel-icon-after' => 'color: {{VALUE}};', |
| 1113 |
'{{WRAPPER}} .eel-button .eel-icon-before svg path, {{WRAPPER}} .eel-button .eel-icon-after svg path' => 'fill: {{VALUE}};', |
| 1114 |
], |
| 1115 |
] |
| 1116 |
); |
| 1117 |
|
| 1118 |
// Normal Background |
| 1119 |
$this->add_group_control( |
| 1120 |
\Elementor\Group_Control_Background::get_type(), |
| 1121 |
[ |
| 1122 |
'name' => 'button_background', |
| 1123 |
'label' => __('Background', 'easy-elements'), |
| 1124 |
'types' => ['classic', 'gradient'], |
| 1125 |
'selector' => '{{WRAPPER}} .eel-button', |
| 1126 |
] |
| 1127 |
); |
| 1128 |
|
| 1129 |
$this->add_group_control( |
| 1130 |
\Elementor\Group_Control_Typography::get_type(), |
| 1131 |
[ |
| 1132 |
'name' => 'button_typography', |
| 1133 |
'selector' => '{{WRAPPER}} .eel-button', |
| 1134 |
] |
| 1135 |
); |
| 1136 |
|
| 1137 |
// Normal Border |
| 1138 |
$this->add_group_control( |
| 1139 |
\Elementor\Group_Control_Border::get_type(), |
| 1140 |
[ |
| 1141 |
'name' => 'button_border', |
| 1142 |
'label' => __('Border', 'easy-elements'), |
| 1143 |
'selector' => '{{WRAPPER}} .eel-button', |
| 1144 |
] |
| 1145 |
); |
| 1146 |
|
| 1147 |
// Normal Box Shadow |
| 1148 |
$this->add_group_control( |
| 1149 |
\Elementor\Group_Control_Box_Shadow::get_type(), |
| 1150 |
[ |
| 1151 |
'name' => 'button_box_shadow', |
| 1152 |
'label' => __('Box Shadow', 'easy-elements'), |
| 1153 |
'selector' => '{{WRAPPER}} .eel-button', |
| 1154 |
] |
| 1155 |
); |
| 1156 |
|
| 1157 |
$this->end_controls_tab(); |
| 1158 |
|
| 1159 |
// Hover Tab |
| 1160 |
$this->start_controls_tab( |
| 1161 |
'button_style_hover', |
| 1162 |
[ |
| 1163 |
'label' => __('Hover', 'easy-elements'), |
| 1164 |
] |
| 1165 |
); |
| 1166 |
|
| 1167 |
// Hover Text Color |
| 1168 |
$this->add_control( |
| 1169 |
'button_text_color_hover', |
| 1170 |
[ |
| 1171 |
'label' => __('Text Color', 'easy-elements'), |
| 1172 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1173 |
'selectors' => [ |
| 1174 |
'{{WRAPPER}} .eel-button:hover' => 'color: {{VALUE}};', |
| 1175 |
], |
| 1176 |
] |
| 1177 |
); |
| 1178 |
|
| 1179 |
// Hover Background |
| 1180 |
$this->add_group_control( |
| 1181 |
\Elementor\Group_Control_Background::get_type(), |
| 1182 |
[ |
| 1183 |
'name' => 'button_background_hover', |
| 1184 |
'label' => __('Background', 'easy-elements'), |
| 1185 |
'types' => ['classic', 'gradient'], |
| 1186 |
'selector' => '{{WRAPPER}} .eel-button:hover', |
| 1187 |
] |
| 1188 |
); |
| 1189 |
|
| 1190 |
// Hover Border |
| 1191 |
$this->add_group_control( |
| 1192 |
\Elementor\Group_Control_Border::get_type(), |
| 1193 |
[ |
| 1194 |
'name' => 'button_border_hover', |
| 1195 |
'label' => __('Border', 'easy-elements'), |
| 1196 |
'selector' => '{{WRAPPER}} .eel-button:hover', |
| 1197 |
] |
| 1198 |
); |
| 1199 |
|
| 1200 |
// Hover Box Shadow |
| 1201 |
$this->add_group_control( |
| 1202 |
\Elementor\Group_Control_Box_Shadow::get_type(), |
| 1203 |
[ |
| 1204 |
'name' => 'button_box_shadow_hover', |
| 1205 |
'label' => __('Box Shadow', 'easy-elements'), |
| 1206 |
'selector' => '{{WRAPPER}} .eel-button:hover', |
| 1207 |
] |
| 1208 |
); |
| 1209 |
|
| 1210 |
$this->end_controls_tab(); |
| 1211 |
|
| 1212 |
$this->end_controls_tabs(); |
| 1213 |
|
| 1214 |
$this->add_responsive_control( |
| 1215 |
'button_border_radius', |
| 1216 |
[ |
| 1217 |
'label' => __('Border Radius', 'easy-elements'), |
| 1218 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1219 |
'size_units' => ['px', '%', 'em'], |
| 1220 |
'selectors' => [ |
| 1221 |
'{{WRAPPER}} .eel-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1222 |
], |
| 1223 |
] |
| 1224 |
); |
| 1225 |
|
| 1226 |
$this->add_responsive_control( |
| 1227 |
'button_padding', |
| 1228 |
[ |
| 1229 |
'label' => __('Padding', 'easy-elements'), |
| 1230 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1231 |
'size_units' => ['px', 'em', '%'], |
| 1232 |
'selectors' => [ |
| 1233 |
'{{WRAPPER}} .eel-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1234 |
], |
| 1235 |
] |
| 1236 |
); |
| 1237 |
|
| 1238 |
$this->add_responsive_control( |
| 1239 |
'button_margin', |
| 1240 |
[ |
| 1241 |
'label' => __('Margin', 'easy-elements'), |
| 1242 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1243 |
'size_units' => ['px', 'em', '%'], |
| 1244 |
'selectors' => [ |
| 1245 |
'{{WRAPPER}} .eel-button' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1246 |
], |
| 1247 |
] |
| 1248 |
); |
| 1249 |
|
| 1250 |
$this->end_controls_section(); |
| 1251 |
|
| 1252 |
$this->start_controls_section( |
| 1253 |
'section_button_subtext_style', |
| 1254 |
[ |
| 1255 |
'label' => __('Button Subtext Style', 'easy-elements'), |
| 1256 |
'tab' => \Elementor\Controls_Manager::TAB_STYLE, |
| 1257 |
] |
| 1258 |
); |
| 1259 |
|
| 1260 |
// Text Color |
| 1261 |
$this->add_control( |
| 1262 |
'button_subtext_color', |
| 1263 |
[ |
| 1264 |
'label' => __('Color', 'easy-elements'), |
| 1265 |
'type' => \Elementor\Controls_Manager::COLOR, |
| 1266 |
'selectors' => [ |
| 1267 |
'{{WRAPPER}} .eel-button-subtext' => 'color: {{VALUE}};', |
| 1268 |
], |
| 1269 |
] |
| 1270 |
); |
| 1271 |
|
| 1272 |
// Typography |
| 1273 |
$this->add_group_control( |
| 1274 |
\Elementor\Group_Control_Typography::get_type(), |
| 1275 |
[ |
| 1276 |
'name' => 'button_subtext_typography', |
| 1277 |
'label' => __('Typography', 'easy-elements'), |
| 1278 |
'selector' => '{{WRAPPER}} .eel-button-subtext', |
| 1279 |
] |
| 1280 |
); |
| 1281 |
|
| 1282 |
$this->add_responsive_control( |
| 1283 |
'button_margin_sub', |
| 1284 |
[ |
| 1285 |
'label' => __('Margin', 'easy-elements'), |
| 1286 |
'type' => \Elementor\Controls_Manager::DIMENSIONS, |
| 1287 |
'size_units' => ['px', 'em', '%'], |
| 1288 |
'selectors' => [ |
| 1289 |
'{{WRAPPER}} .eel-button-subtext' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1290 |
], |
| 1291 |
] |
| 1292 |
); |
| 1293 |
|
| 1294 |
$this->end_controls_section(); |
| 1295 |
|
| 1296 |
} |
| 1297 |
|
| 1298 |
|
| 1299 |
protected function render() { |
| 1300 |
$settings = $this->get_settings_for_display(); |
| 1301 |
$currency = $settings['price_currency']; |
| 1302 |
$currency_pos = $settings['currency_placement']; |
| 1303 |
$period = $settings['price_period']; |
| 1304 |
$separator = $settings['period_separator']; |
| 1305 |
$is_featured = $settings['is_featured'] === 'yes'; |
| 1306 |
$show_button = $settings['show_button'] === 'yes'; |
| 1307 |
$button_pos = $settings['button_position'] ?? 'after_features'; |
| 1308 |
$skin_style = $settings['skin_style'] ?? ''; |
| 1309 |
|
| 1310 |
|
| 1311 |
$render_button = function() use ( $settings ) { |
| 1312 |
if ( $settings['show_button'] !== 'yes' ) { |
| 1313 |
return; |
| 1314 |
} |
| 1315 |
$full_width_class = ( !empty($settings['button_full_width']) && $settings['button_full_width'] === 'yes' ) ? 'eel--full-btn' : ''; |
| 1316 |
$is_external = !empty($settings['button_link']['is_external']) && $settings['button_link']['is_external'] ? ' target="_blank"' : ''; |
| 1317 |
$nofollow = !empty($settings['button_link']['nofollow']) && $settings['button_link']['nofollow'] ? ' rel="nofollow"' : ''; |
| 1318 |
?> |
| 1319 |
<div class="eel-btn-part"> |
| 1320 |
<a href="<?php echo esc_url( $settings['button_link']['url'] ); ?>" |
| 1321 |
<?php echo esc_attr( $is_external ); ?> <?php echo esc_attr( $nofollow ); ?> |
| 1322 |
class="eel-button <?php echo esc_attr( $full_width_class ); ?>"> |
| 1323 |
|
| 1324 |
<?php if ( $settings['button_icon_position'] === 'before' && !empty($settings['button_icon']['value']) ) : ?> |
| 1325 |
<span class="eel-icon eel-icon-before elementor-icon"> |
| 1326 |
<?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?> |
| 1327 |
</span> |
| 1328 |
<?php endif; ?> |
| 1329 |
|
| 1330 |
<?php echo esc_html( $settings['button_text'] ); ?> |
| 1331 |
|
| 1332 |
<?php if ( $settings['button_icon_position'] === 'after' && !empty($settings['button_icon']['value']) ) : ?> |
| 1333 |
<span class="eel-icon eel-icon-after elementor-icon"> |
| 1334 |
<?php Icons_Manager::render_icon( $settings['button_icon'], [ 'aria-hidden' => 'true' ] ); ?> |
| 1335 |
</span> |
| 1336 |
<?php endif; ?> |
| 1337 |
</a> |
| 1338 |
|
| 1339 |
<?php if ( !empty($settings['button_subtext']) ) : ?> |
| 1340 |
<div class="eel-button-subtext"><?php echo esc_html($settings['button_subtext']); ?></div> |
| 1341 |
<?php endif; ?> |
| 1342 |
</div> |
| 1343 |
<?php |
| 1344 |
}; |
| 1345 |
|
| 1346 |
?> |
| 1347 |
<div class="eel-pricing-table <?php echo $is_featured ? 'featured ' . esc_attr($settings['ribbon_style']) : ''; ?> eel--<?php echo esc_attr($skin_style); ?>"> |
| 1348 |
<?php if ($is_featured): ?> |
| 1349 |
<div class="eel-ribbon eel-<?php echo esc_attr($settings['ribbon_alignment']); ?>"> |
| 1350 |
<?php echo esc_html($settings['featured_tag_text']); ?> |
| 1351 |
</div> |
| 1352 |
<?php endif; ?> |
| 1353 |
|
| 1354 |
<h3 class="eel-price-title"><?php echo wp_kses_post($settings['title']); ?></h3> |
| 1355 |
<div class="eel-subtitle-price"> <?php echo wp_kses_post($settings['description']); ?> </div> |
| 1356 |
<div class="eel-price"> |
| 1357 |
<?php if ( $settings['on_sale'] === 'yes' ) : ?> |
| 1358 |
<?php |
| 1359 |
$regular_price = $settings['regular_price']; |
| 1360 |
$sale_price = $settings['sale_price']; |
| 1361 |
?> |
| 1362 |
|
| 1363 |
<span class="eel-old-price"> |
| 1364 |
<?php if ( $currency_pos === 'left' ) : ?> |
| 1365 |
<span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $regular_price ); ?> |
| 1366 |
<?php else : ?> |
| 1367 |
<?php echo esc_html( $regular_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span> |
| 1368 |
<?php endif; ?> |
| 1369 |
</span> |
| 1370 |
|
| 1371 |
<span class="eel-sale-price"> |
| 1372 |
<?php if ( $currency_pos === 'left' ) : ?> |
| 1373 |
<span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $sale_price ); ?> |
| 1374 |
<?php else : ?> |
| 1375 |
<?php echo esc_html( $sale_price ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span> |
| 1376 |
<?php endif; ?> |
| 1377 |
</span> |
| 1378 |
|
| 1379 |
<?php else : ?> |
| 1380 |
<span class="eel-amount"> |
| 1381 |
<?php if ( $currency_pos === 'left' ) : ?> |
| 1382 |
<span class="eel-currency"><?php echo esc_html( $currency ); ?></span><?php echo esc_html( $settings['price'] ); ?> |
| 1383 |
<?php else : ?> |
| 1384 |
<?php echo esc_html( $settings['price'] ); ?><span class="eel-currency"><?php echo esc_html( $currency ); ?></span> |
| 1385 |
<?php endif; ?> |
| 1386 |
</span> |
| 1387 |
<?php endif; ?> |
| 1388 |
|
| 1389 |
<span class="eel-period"><?php echo esc_html( $separator . $period ); ?></span> |
| 1390 |
</div> |
| 1391 |
|
| 1392 |
|
| 1393 |
<?php |
| 1394 |
if ( $settings['button_position'] === 'in_features' ) { |
| 1395 |
$render_button(); |
| 1396 |
} |
| 1397 |
?> |
| 1398 |
|
| 1399 |
<?php if ( !empty($settings['features_des']) ) : ?> |
| 1400 |
<div class="eel-features-description"> |
| 1401 |
<?php echo wp_kses_post($settings['features_des']); ?> |
| 1402 |
</div> |
| 1403 |
<?php endif; ?> |
| 1404 |
|
| 1405 |
<ul class="eel-features"> |
| 1406 |
<?php foreach ( $settings['features_list'] as $feature ) : $icon_style_class = $settings['feature_icon_style']; ?> |
| 1407 |
<li class="<?php echo esc_attr( $icon_style_class ); ?>"> |
| 1408 |
<?php |
| 1409 |
$icon_style_class = 'icon-only'; |
| 1410 |
if ( !empty( $settings['feature_icon_style'] ) ) { |
| 1411 |
$icon_style_class = $settings['feature_icon_style']; |
| 1412 |
} |
| 1413 |
|
| 1414 |
if ( !empty( $feature['icon']['value'] ) ) { |
| 1415 |
Icons_Manager::render_icon( $feature['icon'], [ |
| 1416 |
'aria-hidden' => 'true', |
| 1417 |
'class' => 'feature-icon ' . esc_attr( $icon_style_class ), |
| 1418 |
] ); |
| 1419 |
} else { |
| 1420 |
echo '<i class="unicon-checkmark feature-icon ' . esc_attr( $icon_style_class ) . '" aria-hidden="true"></i>'; |
| 1421 |
} |
| 1422 |
?> |
| 1423 |
<?php echo esc_html( $feature['text'] ); ?> |
| 1424 |
</li> |
| 1425 |
<?php endforeach; ?> |
| 1426 |
</ul> |
| 1427 |
|
| 1428 |
|
| 1429 |
<?php |
| 1430 |
if ( $settings['button_position'] === 'after_features' ) { |
| 1431 |
$render_button(); |
| 1432 |
} |
| 1433 |
?> |
| 1434 |
|
| 1435 |
|
| 1436 |
</div> |
| 1437 |
<?php |
| 1438 |
} |
| 1439 |
} |
| 1440 |
|