dep
1 month ago
premium-banner.php
3 weeks ago
premium-blog.php
3 weeks ago
premium-button.php
3 weeks ago
premium-carousel.php
3 weeks ago
premium-contactform.php
3 weeks ago
premium-countdown.php
3 weeks ago
premium-counter.php
3 weeks ago
premium-dual-header.php
3 weeks ago
premium-fancytext.php
3 weeks ago
premium-grid.php
3 weeks ago
premium-icon-list.php
3 weeks ago
premium-image-button.php
3 weeks ago
premium-image-scroll.php
3 weeks ago
premium-image-separator.php
3 weeks ago
premium-lottie.php
3 weeks ago
premium-maps.php
3 weeks ago
premium-media-wheel.php
3 weeks ago
premium-mobile-menu.php
3 weeks ago
premium-modalbox.php
3 weeks ago
premium-nav-menu.php
3 weeks ago
premium-notifications.php
3 weeks ago
premium-person.php
3 weeks ago
premium-pinterest-feed.php
3 weeks ago
premium-post-ticker.php
3 weeks ago
premium-pricing-table.php
3 weeks ago
premium-progressbar.php
3 weeks ago
premium-search-form.php
3 weeks ago
premium-svg-drawer.php
3 weeks ago
premium-tcloud.php
3 weeks ago
premium-testimonials.php
3 weeks ago
premium-textual-showcase.php
3 weeks ago
premium-tiktok-feed.php
3 weeks ago
premium-title.php
3 weeks ago
premium-videobox.php
3 weeks ago
premium-vscroll.php
3 weeks ago
premium-weather.php
3 weeks ago
premium-world-clock.php
3 weeks ago
premium-pricing-table.php
3931 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Premium Pricing Table. |
| 4 | */ |
| 5 | |
| 6 | namespace PremiumAddons\Widgets; |
| 7 | |
| 8 | // Elementor Classes. |
| 9 | use Elementor\Modules\DynamicTags\Module as TagsModule; |
| 10 | use Elementor\Icons_Manager; |
| 11 | use Elementor\Utils; |
| 12 | use Elementor\Plugin; |
| 13 | use Elementor\Widget_Base; |
| 14 | use Elementor\Controls_Manager; |
| 15 | use Elementor\Control_Media; |
| 16 | use Elementor\Repeater; |
| 17 | use Elementor\Core\Kits\Documents\Tabs\Global_Colors; |
| 18 | use Elementor\Core\Kits\Documents\Tabs\Global_Typography; |
| 19 | use Elementor\Group_Control_Border; |
| 20 | use Elementor\Group_Control_Typography; |
| 21 | use Elementor\Group_Control_Box_Shadow; |
| 22 | use PremiumAddons\Includes\Controls\Premium_Background; |
| 23 | |
| 24 | // PremiumAddons Classes. |
| 25 | use PremiumAddons\Admin\Includes\Admin_Helper; |
| 26 | use PremiumAddons\Includes\Helper_Functions; |
| 27 | use PremiumAddons\Includes\Controls\Premium_Post_Filter; |
| 28 | |
| 29 | if ( ! defined( 'ABSPATH' ) ) { |
| 30 | exit; // If this file is called directly, abort. |
| 31 | } |
| 32 | /** |
| 33 | * Class Premium_Pricing_Table |
| 34 | */ |
| 35 | class Premium_Pricing_Table extends Widget_Base { |
| 36 | |
| 37 | /** |
| 38 | * Check if the icon draw is enabled. |
| 39 | * |
| 40 | * @since 4.9.26 |
| 41 | * @access private |
| 42 | * |
| 43 | * @var bool |
| 44 | */ |
| 45 | private $is_draw_enabled = null; |
| 46 | |
| 47 | /** |
| 48 | * Check Icon Draw Option. |
| 49 | * |
| 50 | * @since 4.9.26 |
| 51 | * @access public |
| 52 | */ |
| 53 | public function check_icon_draw() { |
| 54 | |
| 55 | if ( null === $this->is_draw_enabled ) { |
| 56 | $this->is_draw_enabled = Admin_Helper::check_svg_draw( 'premium-pricing-table' ); |
| 57 | } |
| 58 | |
| 59 | return $this->is_draw_enabled; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Retrieve Widget Name. |
| 64 | * |
| 65 | * @since 1.0.0 |
| 66 | * @access public |
| 67 | */ |
| 68 | public function get_name() { |
| 69 | return 'premium-addon-pricing-table'; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Retrieve Widget Title. |
| 74 | * |
| 75 | * @since 1.0.0 |
| 76 | * @access public |
| 77 | */ |
| 78 | public function get_title() { |
| 79 | return __( 'Pricing Table', 'premium-addons-for-elementor' ); |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Retrieve Widget Icon. |
| 84 | * |
| 85 | * @since 1.0.0 |
| 86 | * @access public |
| 87 | * |
| 88 | * @return string widget icon. |
| 89 | */ |
| 90 | public function get_icon() { |
| 91 | return 'pa-pricing-table'; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Retrieve Widget Dependent CSS. |
| 96 | * |
| 97 | * @since 1.0.0 |
| 98 | * @access public |
| 99 | * |
| 100 | * @return array CSS style handles. |
| 101 | */ |
| 102 | public function get_style_depends() { |
| 103 | return array( |
| 104 | 'pa-glass', |
| 105 | 'pa-btn', |
| 106 | 'premium-addons', |
| 107 | ); |
| 108 | } |
| 109 | |
| 110 | |
| 111 | /** |
| 112 | * Retrieve Widget Dependent JS. |
| 113 | * |
| 114 | * @since 1.0.0 |
| 115 | * @access public |
| 116 | * |
| 117 | * @return array JS script handles. |
| 118 | */ |
| 119 | public function get_script_depends() { |
| 120 | |
| 121 | $is_edit = Helper_Functions::is_edit_mode(); |
| 122 | |
| 123 | $scripts = array(); |
| 124 | |
| 125 | if ( $is_edit ) { |
| 126 | |
| 127 | $draw_scripts = $this->check_icon_draw() ? array( 'pa-tweenmax', 'pa-motionpath' ) : array(); |
| 128 | |
| 129 | $scripts = array_merge( $draw_scripts, array( 'pa-glass', 'lottie-js' ) ); |
| 130 | |
| 131 | } else { |
| 132 | $settings = $this->get_settings(); |
| 133 | |
| 134 | // Check main icon settings. |
| 135 | if ( 'yes' === $settings['premium_pricing_table_icon_switcher'] ) { |
| 136 | |
| 137 | if ( 'yes' === $settings['draw_svg'] ) { |
| 138 | $scripts[] = 'pa-tweenmax'; |
| 139 | $scripts[] = 'pa-motionpath'; |
| 140 | } |
| 141 | |
| 142 | if ( 'animation' === $settings['icon_type'] ) { |
| 143 | $scripts[] = 'lottie-js'; |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // Check feature list items settings. |
| 148 | if ( 'yes' === $settings['premium_pricing_table_list_switcher'] && ! empty( $settings['premium_fancy_text_list_items'] ) ) { |
| 149 | foreach ( $settings['premium_fancy_text_list_items'] as $item ) { |
| 150 | if ( 'yes' === $item['draw_svg'] ) { |
| 151 | $scripts[] = 'pa-tweenmax'; |
| 152 | $scripts[] = 'pa-motionpath'; |
| 153 | $draw_js = true; |
| 154 | } |
| 155 | |
| 156 | if ( 'animation' === $item['icon_type'] ) { |
| 157 | $scripts[] = 'lottie-js'; |
| 158 | $lottie_js = true; |
| 159 | } |
| 160 | |
| 161 | if ( isset( $draw_js ) && isset( $lottie_js ) ) { |
| 162 | break; |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | if ( 'none' !== $settings['price_lq_effect'] ) { |
| 168 | $scripts[] = 'pa-glass'; |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | return $scripts; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Retrieve Widget Categories. |
| 177 | * |
| 178 | * @since 1.0.0 |
| 179 | * @access public |
| 180 | * |
| 181 | * @return string Widget Categories. |
| 182 | */ |
| 183 | public function get_categories() { |
| 184 | return array( 'premium-elements' ); |
| 185 | } |
| 186 | |
| 187 | /** |
| 188 | * Retrieve Widget Keywords. |
| 189 | * |
| 190 | * @since 1.0.0 |
| 191 | * @access public |
| 192 | * |
| 193 | * @return string Widget keywords. |
| 194 | */ |
| 195 | public function get_keywords() { |
| 196 | return array( 'pa', 'premium', 'premium pricing table', 'price', 'feature', 'list', 'bullet', 'cta' ); |
| 197 | } |
| 198 | |
| 199 | protected function is_dynamic_content(): bool { |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | /** |
| 204 | * Retrieve Widget Support URL. |
| 205 | * |
| 206 | * @access public |
| 207 | * |
| 208 | * @return string support URL. |
| 209 | */ |
| 210 | public function get_custom_help_url() { |
| 211 | return 'https://premiumaddons.com/support/'; |
| 212 | } |
| 213 | |
| 214 | public function has_widget_inner_wrapper(): bool { |
| 215 | return ! Helper_Functions::check_elementor_experiment( 'e_optimized_markup' ); |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Register Pricing Table controls. |
| 220 | * |
| 221 | * @since 1.0.0 |
| 222 | * @access protected |
| 223 | */ |
| 224 | protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore |
| 225 | |
| 226 | $draw_icon = $this->check_icon_draw(); |
| 227 | |
| 228 | $this->add_content_tab_sections( $draw_icon ); |
| 229 | |
| 230 | Helper_Functions::register_papro_promotion_controls( $this, 'pricing' ); |
| 231 | |
| 232 | $this->add_style_tab_sections( $draw_icon ); |
| 233 | } |
| 234 | |
| 235 | private function add_content_tab_sections( $draw_icon ) { |
| 236 | $animation_conds = array( |
| 237 | 'relation' => 'or', |
| 238 | 'terms' => array( |
| 239 | array( |
| 240 | 'name' => 'icon_type', |
| 241 | 'value' => 'animation', |
| 242 | ), |
| 243 | array( |
| 244 | 'terms' => array( |
| 245 | array( |
| 246 | 'relation' => 'or', |
| 247 | 'terms' => array( |
| 248 | array( |
| 249 | 'name' => 'icon_type', |
| 250 | 'value' => 'icon', |
| 251 | ), |
| 252 | array( |
| 253 | 'name' => 'icon_type', |
| 254 | 'value' => 'svg', |
| 255 | ), |
| 256 | ), |
| 257 | ), |
| 258 | array( |
| 259 | 'name' => 'draw_svg', |
| 260 | 'value' => 'yes', |
| 261 | ), |
| 262 | ), |
| 263 | ), |
| 264 | ), |
| 265 | |
| 266 | ); |
| 267 | |
| 268 | $this->add_icon_controls( $draw_icon, $animation_conds ); |
| 269 | $this->add_title_controls(); |
| 270 | $this->add_price_controls(); |
| 271 | $this->add_featured_list_controls( $draw_icon, $animation_conds ); |
| 272 | $this->add_description_controls(); |
| 273 | $this->add_button_controls(); |
| 274 | $this->add_ribbon_controls(); |
| 275 | $this->add_display_option_controls(); |
| 276 | } |
| 277 | |
| 278 | private function add_style_tab_sections( $draw_icon ) { |
| 279 | $this->add_icon_style_controls( $draw_icon ); |
| 280 | $this->add_title_style_controls(); |
| 281 | $this->add_price_style_controls(); |
| 282 | $this->add_feature_list_style_controls(); |
| 283 | $this->add_tooltips_style_controls(); |
| 284 | $this->add_description_style_controls(); |
| 285 | $this->add_button_style_controls(); |
| 286 | $this->add_ribbon_style_controls(); |
| 287 | $this->add_box_style_controls(); |
| 288 | } |
| 289 | |
| 290 | private function add_icon_controls( $draw_icon, $animation_conds ) { |
| 291 | $this->start_controls_section( |
| 292 | 'premium_pricing_table_icon_section', |
| 293 | array( |
| 294 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 295 | 'condition' => array( |
| 296 | 'premium_pricing_table_icon_switcher' => 'yes', |
| 297 | ), |
| 298 | ) |
| 299 | ); |
| 300 | |
| 301 | $this->add_control( |
| 302 | 'icon_type', |
| 303 | array( |
| 304 | 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ), |
| 305 | 'type' => Controls_Manager::SELECT, |
| 306 | 'options' => array( |
| 307 | 'icon' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 308 | 'image' => __( 'Image', 'premium-addons-for-elementor' ), |
| 309 | 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ), |
| 310 | 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 311 | ), |
| 312 | 'default' => 'icon', |
| 313 | ) |
| 314 | ); |
| 315 | |
| 316 | $this->add_control( |
| 317 | 'premium_pricing_table_icon_selection_updated', |
| 318 | array( |
| 319 | 'label' => __( 'Select an Icon', 'premium-addons-for-elementor' ), |
| 320 | 'type' => Controls_Manager::ICONS, |
| 321 | 'fa4compatibility' => 'premium_pricing_table_icon_selection', |
| 322 | 'default' => array( |
| 323 | 'value' => 'fas fa-star', |
| 324 | 'library' => 'fa-solid', |
| 325 | ), |
| 326 | 'condition' => array( |
| 327 | 'icon_type' => 'icon', |
| 328 | ), |
| 329 | ) |
| 330 | ); |
| 331 | |
| 332 | $this->add_control( |
| 333 | 'lottie_url', |
| 334 | array( |
| 335 | 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ), |
| 336 | 'type' => Controls_Manager::TEXT, |
| 337 | 'dynamic' => array( 'active' => true ), |
| 338 | 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>', |
| 339 | 'label_block' => true, |
| 340 | 'condition' => array( |
| 341 | 'icon_type' => 'animation', |
| 342 | ), |
| 343 | 'ai' => array( |
| 344 | 'active' => false, |
| 345 | ), |
| 346 | ) |
| 347 | ); |
| 348 | |
| 349 | $this->add_control( |
| 350 | 'custom_svg', |
| 351 | array( |
| 352 | 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 353 | 'type' => Controls_Manager::TEXTAREA, |
| 354 | 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>', |
| 355 | 'condition' => array( |
| 356 | 'icon_type' => 'svg', |
| 357 | ), |
| 358 | 'ai' => array( |
| 359 | 'active' => false, |
| 360 | ), |
| 361 | ) |
| 362 | ); |
| 363 | |
| 364 | $this->add_control( |
| 365 | 'draw_svg', |
| 366 | array( |
| 367 | 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ), |
| 368 | 'type' => Controls_Manager::SWITCHER, |
| 369 | 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=ZLr0bRe0RAY" target="_blank">tutorial</a>', |
| 370 | 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled', |
| 371 | 'condition' => array( |
| 372 | 'icon_type' => array( 'icon', 'svg' ), |
| 373 | 'premium_pricing_table_icon_selection_updated[library]!' => 'svg', |
| 374 | ), |
| 375 | ) |
| 376 | ); |
| 377 | |
| 378 | if ( $draw_icon ) { |
| 379 | $this->add_control( |
| 380 | 'path_width', |
| 381 | array( |
| 382 | 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ), |
| 383 | 'type' => Controls_Manager::SLIDER, |
| 384 | 'range' => array( |
| 385 | 'px' => array( |
| 386 | 'min' => 0, |
| 387 | 'max' => 50, |
| 388 | 'step' => 0.1, |
| 389 | ), |
| 390 | ), |
| 391 | 'condition' => array( |
| 392 | 'icon_type' => array( 'icon', 'svg' ), |
| 393 | ), |
| 394 | 'selectors' => array( |
| 395 | '{{WRAPPER}} .premium-pricing-icon-container svg *' => 'stroke-width: {{SIZE}}', |
| 396 | ), |
| 397 | ) |
| 398 | ); |
| 399 | |
| 400 | $this->add_control( |
| 401 | 'svg_sync', |
| 402 | array( |
| 403 | 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ), |
| 404 | 'type' => Controls_Manager::SWITCHER, |
| 405 | 'condition' => array( |
| 406 | 'icon_type' => array( 'icon', 'svg' ), |
| 407 | 'draw_svg' => 'yes', |
| 408 | ), |
| 409 | ) |
| 410 | ); |
| 411 | |
| 412 | $this->add_control( |
| 413 | 'frames', |
| 414 | array( |
| 415 | 'label' => __( 'Speed', 'premium-addons-for-elementor' ), |
| 416 | 'type' => Controls_Manager::NUMBER, |
| 417 | 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ), |
| 418 | 'default' => 5, |
| 419 | 'min' => 1, |
| 420 | 'max' => 100, |
| 421 | 'condition' => array( |
| 422 | 'icon_type' => array( 'icon', 'svg' ), |
| 423 | 'draw_svg' => 'yes', |
| 424 | ), |
| 425 | ) |
| 426 | ); |
| 427 | } else { |
| 428 | |
| 429 | Helper_Functions::get_draw_svg_notice( |
| 430 | $this, |
| 431 | 'pricing', |
| 432 | array( |
| 433 | 'icon_type' => array( 'icon', 'svg' ), |
| 434 | 'premium_pricing_table_icon_selection_updated[library]!' => 'svg', |
| 435 | ) |
| 436 | ); |
| 437 | |
| 438 | } |
| 439 | |
| 440 | $this->add_control( |
| 441 | 'lottie_loop', |
| 442 | array( |
| 443 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 444 | 'type' => Controls_Manager::SWITCHER, |
| 445 | 'return_value' => 'true', |
| 446 | 'default' => 'true', |
| 447 | 'conditions' => $animation_conds, |
| 448 | ) |
| 449 | ); |
| 450 | |
| 451 | $this->add_control( |
| 452 | 'lottie_reverse', |
| 453 | array( |
| 454 | 'label' => __( 'Reverse', 'premium-addons-for-elementor' ), |
| 455 | 'type' => Controls_Manager::SWITCHER, |
| 456 | 'return_value' => 'true', |
| 457 | 'conditions' => $animation_conds, |
| 458 | ) |
| 459 | ); |
| 460 | |
| 461 | if ( $draw_icon ) { |
| 462 | $this->add_control( |
| 463 | 'start_point', |
| 464 | array( |
| 465 | 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ), |
| 466 | 'type' => Controls_Manager::SLIDER, |
| 467 | 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ), |
| 468 | 'default' => array( |
| 469 | 'unit' => '%', |
| 470 | 'size' => 0, |
| 471 | ), |
| 472 | 'condition' => array( |
| 473 | 'icon_type' => array( 'icon', 'svg' ), |
| 474 | 'draw_svg' => 'yes', |
| 475 | 'lottie_reverse!' => 'true', |
| 476 | ), |
| 477 | ) |
| 478 | ); |
| 479 | |
| 480 | $this->add_control( |
| 481 | 'end_point', |
| 482 | array( |
| 483 | 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ), |
| 484 | 'type' => Controls_Manager::SLIDER, |
| 485 | 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ), |
| 486 | 'default' => array( |
| 487 | 'unit' => '%', |
| 488 | 'size' => 0, |
| 489 | ), |
| 490 | 'condition' => array( |
| 491 | 'icon_type' => array( 'icon', 'svg' ), |
| 492 | 'draw_svg' => 'yes', |
| 493 | 'lottie_reverse' => 'true', |
| 494 | ), |
| 495 | ) |
| 496 | ); |
| 497 | |
| 498 | $this->add_control( |
| 499 | 'svg_hover', |
| 500 | array( |
| 501 | 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ), |
| 502 | 'type' => Controls_Manager::SWITCHER, |
| 503 | 'return_value' => 'true', |
| 504 | 'condition' => array( |
| 505 | 'icon_type' => array( 'icon', 'svg' ), |
| 506 | 'draw_svg' => 'yes', |
| 507 | ), |
| 508 | ) |
| 509 | ); |
| 510 | |
| 511 | $this->add_control( |
| 512 | 'svg_yoyo', |
| 513 | array( |
| 514 | 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ), |
| 515 | 'type' => Controls_Manager::SWITCHER, |
| 516 | 'condition' => array( |
| 517 | 'icon_type' => array( 'icon', 'svg' ), |
| 518 | 'draw_svg' => 'yes', |
| 519 | 'lottie_loop' => 'true', |
| 520 | ), |
| 521 | ) |
| 522 | ); |
| 523 | } |
| 524 | |
| 525 | $this->add_control( |
| 526 | 'premium_pricing_table_image', |
| 527 | array( |
| 528 | 'label' => __( 'Choose Image', 'premium-addons-for-elementor' ), |
| 529 | 'type' => Controls_Manager::MEDIA, |
| 530 | 'default' => array( |
| 531 | 'url' => Utils::get_placeholder_image_src(), |
| 532 | ), |
| 533 | 'condition' => array( |
| 534 | 'icon_type' => 'image', |
| 535 | ), |
| 536 | ) |
| 537 | ); |
| 538 | |
| 539 | $this->add_control( |
| 540 | 'icon_order', |
| 541 | array( |
| 542 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 543 | 'type' => Controls_Manager::NUMBER, |
| 544 | 'separator' => 'before', |
| 545 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 546 | 'default' => 1, |
| 547 | 'selectors' => array( |
| 548 | '{{WRAPPER}} .premium-pricing-icon-container' => 'order: {{VALUE}};', |
| 549 | ), |
| 550 | ) |
| 551 | ); |
| 552 | |
| 553 | $this->end_controls_section(); |
| 554 | } |
| 555 | |
| 556 | private function add_title_controls() { |
| 557 | $this->start_controls_section( |
| 558 | 'premium_pricing_table_title_section', |
| 559 | array( |
| 560 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 561 | 'condition' => array( |
| 562 | 'premium_pricing_table_title_switcher' => 'yes', |
| 563 | ), |
| 564 | ) |
| 565 | ); |
| 566 | |
| 567 | $demo = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-pricing-table-widget/', 'pricing', 'wp-editor', 'demo' ); |
| 568 | Helper_Functions::add_templates_controls( $this, 'pricing-table', $demo ); |
| 569 | |
| 570 | $this->add_control( |
| 571 | 'premium_pricing_table_title_text', |
| 572 | array( |
| 573 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 574 | 'default' => __( 'Pricing Table', 'premium-addons-for-elementor' ), |
| 575 | 'type' => Controls_Manager::TEXT, |
| 576 | 'dynamic' => array( 'active' => true ), |
| 577 | 'label_block' => true, |
| 578 | ) |
| 579 | ); |
| 580 | |
| 581 | $this->add_control( |
| 582 | 'premium_pricing_table_title_size', |
| 583 | array( |
| 584 | 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ), |
| 585 | 'description' => __( 'Select HTML tag for the title', 'premium-addons-for-elementor' ), |
| 586 | 'type' => Controls_Manager::SELECT, |
| 587 | 'default' => 'h3', |
| 588 | 'options' => array( |
| 589 | 'h1' => 'H1', |
| 590 | 'h2' => 'H2', |
| 591 | 'h3' => 'H3', |
| 592 | 'h4' => 'H4', |
| 593 | 'h5' => 'H5', |
| 594 | 'h6' => 'H6', |
| 595 | 'div' => 'div', |
| 596 | 'span' => 'span', |
| 597 | 'p' => 'p', |
| 598 | ), |
| 599 | 'label_block' => true, |
| 600 | ) |
| 601 | ); |
| 602 | |
| 603 | $this->add_control( |
| 604 | 'title_order', |
| 605 | array( |
| 606 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 607 | 'type' => Controls_Manager::NUMBER, |
| 608 | 'separator' => 'before', |
| 609 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 610 | 'default' => 1, |
| 611 | 'selectors' => array( |
| 612 | '{{WRAPPER}} .premium-pricing-table-title' => 'order: {{VALUE}};', |
| 613 | ), |
| 614 | ) |
| 615 | ); |
| 616 | |
| 617 | $this->end_controls_section(); |
| 618 | } |
| 619 | |
| 620 | private function add_price_controls() { |
| 621 | |
| 622 | $this->start_controls_section( |
| 623 | 'premium_pricing_table_price_section', |
| 624 | array( |
| 625 | 'label' => __( 'Price', 'premium-addons-for-elementor' ), |
| 626 | 'condition' => array( |
| 627 | 'premium_pricing_table_price_switcher' => 'yes', |
| 628 | ), |
| 629 | ) |
| 630 | ); |
| 631 | |
| 632 | $this->add_control( |
| 633 | 'premium_pricing_table_slashed_price_value', |
| 634 | array( |
| 635 | 'label' => __( 'Slashed Price', 'premium-addons-for-elementor' ), |
| 636 | 'description' => __( 'Enabling Discount Reveal automatically adds the currency to the Slashed Price, if available.', 'premium-addons-for-elementor' ), |
| 637 | 'type' => Controls_Manager::TEXT, |
| 638 | 'dynamic' => array( 'active' => true ), |
| 639 | 'label_block' => true, |
| 640 | 'ai' => array( |
| 641 | 'active' => false, |
| 642 | ), |
| 643 | ) |
| 644 | ); |
| 645 | |
| 646 | $this->add_control( |
| 647 | 'price_display', |
| 648 | array( |
| 649 | 'label' => __( 'Display', 'premium-addons-for-elementor' ), |
| 650 | 'type' => Controls_Manager::CHOOSE, |
| 651 | 'prefix_class' => 'pa-d-price-', |
| 652 | 'options' => array( |
| 653 | 'row' => array( |
| 654 | 'title' => __( 'Inline', 'premium-addons-for-elementor' ), |
| 655 | 'icon' => 'eicon-ellipsis-h', |
| 656 | ), |
| 657 | 'column' => array( |
| 658 | 'title' => __( 'Block', 'premium-addons-for-elementor' ), |
| 659 | 'icon' => 'eicon-ellipsis-v', |
| 660 | ), |
| 661 | ), |
| 662 | 'default' => 'row', |
| 663 | 'toggle' => false, |
| 664 | 'selectors' => array( |
| 665 | '{{WRAPPER}} .premium-pricing-inner-wrapper ' => 'flex-direction: {{VALUE}}', |
| 666 | ), |
| 667 | 'condition' => array( |
| 668 | 'premium_pricing_table_slashed_price_value!' => '', |
| 669 | 'price_effects!' => 'effect-1', |
| 670 | ), |
| 671 | ) |
| 672 | ); |
| 673 | |
| 674 | $this->add_control( |
| 675 | 'slashed_price_placement', |
| 676 | array( |
| 677 | 'label' => __( 'Placement', 'premium-addons-for-elementor' ), |
| 678 | 'type' => Controls_Manager::CHOOSE, |
| 679 | 'options' => array( |
| 680 | '0' => array( |
| 681 | 'title' => __( 'Default', 'premium-addons-for-elementor' ), |
| 682 | 'icon' => 'eicon-order-start', |
| 683 | ), |
| 684 | '1' => array( |
| 685 | 'title' => __( 'Reverse', 'premium-addons-for-elementor' ), |
| 686 | 'icon' => 'eicon-order-end', |
| 687 | ), |
| 688 | ), |
| 689 | 'default' => '0', |
| 690 | 'toggle' => false, |
| 691 | 'selectors' => array( |
| 692 | '{{WRAPPER}} .premium-pricing-slashed-price-value' => 'order: {{VALUE}}', |
| 693 | ), |
| 694 | 'condition' => array( |
| 695 | 'premium_pricing_table_slashed_price_value!' => '', |
| 696 | 'price_effects!' => 'effect-1', |
| 697 | ), |
| 698 | ) |
| 699 | ); |
| 700 | |
| 701 | $this->add_control( |
| 702 | 'price_effects', |
| 703 | array( |
| 704 | 'label' => __( 'Discount Reveal Effect', 'premium-addons-for-elementor' ), |
| 705 | 'type' => Controls_Manager::SWITCHER, |
| 706 | 'return_value' => 'effect-1', |
| 707 | 'default' => '', |
| 708 | 'prefix_class' => 'pa-bt-effect__', |
| 709 | 'render_type' => 'template', |
| 710 | 'condition' => array( |
| 711 | 'premium_pricing_table_slashed_price_value!' => '', |
| 712 | ), |
| 713 | ), |
| 714 | ); |
| 715 | |
| 716 | $this->add_control( |
| 717 | 'premium_pricing_table_price_currency', |
| 718 | array( |
| 719 | 'label' => __( 'Currency', 'premium-addons-for-elementor' ), |
| 720 | 'type' => Controls_Manager::TEXT, |
| 721 | 'dynamic' => array( 'active' => true ), |
| 722 | 'default' => '$', |
| 723 | 'separator' => 'before', |
| 724 | 'label_block' => true, |
| 725 | 'ai' => array( |
| 726 | 'active' => false, |
| 727 | ), |
| 728 | ) |
| 729 | ); |
| 730 | |
| 731 | $this->add_control( |
| 732 | 'premium_pricing_table_price_value', |
| 733 | array( |
| 734 | 'label' => __( 'Price', 'premium-addons-for-elementor' ), |
| 735 | 'type' => Controls_Manager::TEXT, |
| 736 | 'dynamic' => array( 'active' => true ), |
| 737 | 'default' => '25', |
| 738 | 'label_block' => true, |
| 739 | 'ai' => array( |
| 740 | 'active' => false, |
| 741 | ), |
| 742 | ) |
| 743 | ); |
| 744 | |
| 745 | $this->add_control( |
| 746 | 'premium_pricing_table_price_separator', |
| 747 | array( |
| 748 | 'label' => __( 'Divider', 'premium-addons-for-elementor' ), |
| 749 | 'type' => Controls_Manager::TEXT, |
| 750 | 'dynamic' => array( 'active' => true ), |
| 751 | 'default' => '/', |
| 752 | 'label_block' => true, |
| 753 | 'ai' => array( |
| 754 | 'active' => false, |
| 755 | ), |
| 756 | ) |
| 757 | ); |
| 758 | |
| 759 | /*Price Duration*/ |
| 760 | $this->add_control( |
| 761 | 'premium_pricing_table_price_duration', |
| 762 | array( |
| 763 | 'label' => __( 'Duration', 'premium-addons-for-elementor' ), |
| 764 | 'type' => Controls_Manager::TEXT, |
| 765 | 'dynamic' => array( 'active' => true ), |
| 766 | 'default' => 'm', |
| 767 | 'label_block' => true, |
| 768 | 'ai' => array( |
| 769 | 'active' => false, |
| 770 | ), |
| 771 | ) |
| 772 | ); |
| 773 | |
| 774 | $this->add_control( |
| 775 | 'price_order', |
| 776 | array( |
| 777 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 778 | 'type' => Controls_Manager::NUMBER, |
| 779 | 'separator' => 'before', |
| 780 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 781 | 'default' => 1, |
| 782 | 'selectors' => array( |
| 783 | '{{WRAPPER}} .premium-pricing-price-container' => 'order: {{VALUE}};', |
| 784 | ), |
| 785 | ) |
| 786 | ); |
| 787 | |
| 788 | $this->end_controls_section(); |
| 789 | } |
| 790 | |
| 791 | private function add_featured_list_controls( $draw_icon, $animation_conds ) { |
| 792 | $this->start_controls_section( |
| 793 | 'premium_pricing_table_list_section', |
| 794 | array( |
| 795 | 'label' => __( 'Feature List', 'premium-addons-for-elementor' ), |
| 796 | 'condition' => array( |
| 797 | 'premium_pricing_table_list_switcher' => 'yes', |
| 798 | ), |
| 799 | ) |
| 800 | ); |
| 801 | |
| 802 | $repeater = new REPEATER(); |
| 803 | |
| 804 | $repeater->add_control( |
| 805 | 'premium_pricing_list_item_text', |
| 806 | array( |
| 807 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 808 | 'type' => Controls_Manager::TEXT, |
| 809 | 'default' => __( 'Feature Title', 'premium-addons-for-elementor' ), |
| 810 | 'dynamic' => array( 'active' => true ), |
| 811 | 'label_block' => true, |
| 812 | 'ai' => array( |
| 813 | 'active' => false, |
| 814 | ), |
| 815 | ) |
| 816 | ); |
| 817 | |
| 818 | $repeater->add_control( |
| 819 | 'icon_type', |
| 820 | array( |
| 821 | 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ), |
| 822 | 'type' => Controls_Manager::SELECT, |
| 823 | 'options' => array( |
| 824 | 'icon' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 825 | 'image' => __( 'Image', 'premium-addons-for-elementor' ), |
| 826 | 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ), |
| 827 | 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 828 | ), |
| 829 | 'default' => 'icon', |
| 830 | ) |
| 831 | ); |
| 832 | |
| 833 | $repeater->add_control( |
| 834 | 'premium_pricing_list_item_icon_updated', |
| 835 | array( |
| 836 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 837 | 'type' => Controls_Manager::ICONS, |
| 838 | 'fa4compatibility' => 'premium_pricing_list_item_icon', |
| 839 | 'default' => array( |
| 840 | 'value' => 'fas fa-check', |
| 841 | 'library' => 'fa-solid', |
| 842 | ), |
| 843 | 'condition' => array( |
| 844 | 'icon_type' => 'icon', |
| 845 | ), |
| 846 | ) |
| 847 | ); |
| 848 | |
| 849 | $repeater->add_control( |
| 850 | 'custom_svg', |
| 851 | array( |
| 852 | 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ), |
| 853 | 'type' => Controls_Manager::TEXTAREA, |
| 854 | 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>', |
| 855 | 'condition' => array( |
| 856 | 'icon_type' => 'svg', |
| 857 | ), |
| 858 | 'ai' => array( |
| 859 | 'active' => false, |
| 860 | ), |
| 861 | |
| 862 | ) |
| 863 | ); |
| 864 | |
| 865 | $repeater->add_control( |
| 866 | 'lottie_url', |
| 867 | array( |
| 868 | 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ), |
| 869 | 'type' => Controls_Manager::TEXT, |
| 870 | 'dynamic' => array( 'active' => true ), |
| 871 | 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>', |
| 872 | 'label_block' => true, |
| 873 | 'condition' => array( |
| 874 | 'icon_type' => 'animation', |
| 875 | ), |
| 876 | 'ai' => array( |
| 877 | 'active' => false, |
| 878 | ), |
| 879 | ) |
| 880 | ); |
| 881 | |
| 882 | $repeater->add_control( |
| 883 | 'draw_svg', |
| 884 | array( |
| 885 | 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ), |
| 886 | 'type' => Controls_Manager::SWITCHER, |
| 887 | 'description' => __( 'Enable this option to make the icon drawable. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=ZLr0bRe0RAY" target="_blank">tutorial</a>', |
| 888 | 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled', |
| 889 | 'condition' => array( |
| 890 | 'icon_type' => array( 'icon', 'svg' ), |
| 891 | 'premium_pricing_list_item_icon_updated[library]!' => 'svg', |
| 892 | ), |
| 893 | ) |
| 894 | ); |
| 895 | |
| 896 | if ( $draw_icon ) { |
| 897 | $repeater->add_control( |
| 898 | 'path_width', |
| 899 | array( |
| 900 | 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ), |
| 901 | 'type' => Controls_Manager::SLIDER, |
| 902 | 'range' => array( |
| 903 | 'px' => array( |
| 904 | 'min' => 0, |
| 905 | 'max' => 50, |
| 906 | 'step' => 0.1, |
| 907 | ), |
| 908 | ), |
| 909 | 'condition' => array( |
| 910 | 'icon_type' => array( 'icon', 'svg' ), |
| 911 | ), |
| 912 | 'selectors' => array( |
| 913 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-pricing-list-item svg *' => 'stroke-width: {{SIZE}}', |
| 914 | ), |
| 915 | ) |
| 916 | ); |
| 917 | |
| 918 | $repeater->add_control( |
| 919 | 'svg_sync', |
| 920 | array( |
| 921 | 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ), |
| 922 | 'type' => Controls_Manager::SWITCHER, |
| 923 | 'condition' => array( |
| 924 | 'icon_type' => array( 'icon', 'svg' ), |
| 925 | 'draw_svg' => 'yes', |
| 926 | ), |
| 927 | ) |
| 928 | ); |
| 929 | |
| 930 | $repeater->add_control( |
| 931 | 'frames', |
| 932 | array( |
| 933 | 'label' => __( 'Speed', 'premium-addons-for-elementor' ), |
| 934 | 'type' => Controls_Manager::NUMBER, |
| 935 | 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ), |
| 936 | 'default' => 5, |
| 937 | 'min' => 1, |
| 938 | 'max' => 100, |
| 939 | 'condition' => array( |
| 940 | 'icon_type' => array( 'icon', 'svg' ), |
| 941 | 'draw_svg' => 'yes', |
| 942 | ), |
| 943 | ) |
| 944 | ); |
| 945 | |
| 946 | } else { |
| 947 | |
| 948 | Helper_Functions::get_draw_svg_notice( |
| 949 | $repeater, |
| 950 | 'pricing', |
| 951 | array( |
| 952 | 'icon_type' => array( 'icon', 'svg' ), |
| 953 | 'premium_pricing_list_item_icon_updated[library]!' => 'svg', |
| 954 | ) |
| 955 | ); |
| 956 | |
| 957 | } |
| 958 | |
| 959 | $repeater->add_control( |
| 960 | 'lottie_loop', |
| 961 | array( |
| 962 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 963 | 'type' => Controls_Manager::SWITCHER, |
| 964 | 'return_value' => 'true', |
| 965 | 'default' => 'true', |
| 966 | 'conditions' => $animation_conds, |
| 967 | ) |
| 968 | ); |
| 969 | |
| 970 | if ( $draw_icon ) { |
| 971 | $repeater->add_control( |
| 972 | 'svg_notice', |
| 973 | array( |
| 974 | 'raw' => __( 'Loop and Speed options are overriden when Draw SVGs in Sequence option is enabled.', 'premium-addons-for-elementor' ), |
| 975 | 'type' => Controls_Manager::RAW_HTML, |
| 976 | 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', |
| 977 | 'condition' => array( |
| 978 | 'icon_type' => array( 'icon', 'svg' ), |
| 979 | 'draw_svg' => 'yes', |
| 980 | ), |
| 981 | ) |
| 982 | ); |
| 983 | } |
| 984 | |
| 985 | $repeater->add_control( |
| 986 | 'lottie_reverse', |
| 987 | array( |
| 988 | 'label' => __( 'Reverse', 'premium-addons-for-elementor' ), |
| 989 | 'type' => Controls_Manager::SWITCHER, |
| 990 | 'return_value' => 'true', |
| 991 | 'conditions' => $animation_conds, |
| 992 | ) |
| 993 | ); |
| 994 | |
| 995 | if ( $draw_icon ) { |
| 996 | $repeater->add_control( |
| 997 | 'start_point', |
| 998 | array( |
| 999 | 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ), |
| 1000 | 'type' => Controls_Manager::SLIDER, |
| 1001 | 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ), |
| 1002 | 'default' => array( |
| 1003 | 'unit' => '%', |
| 1004 | 'size' => 0, |
| 1005 | ), |
| 1006 | 'condition' => array( |
| 1007 | 'icon_type' => array( 'icon', 'svg' ), |
| 1008 | 'draw_svg' => 'yes', |
| 1009 | 'lottie_reverse!' => 'true', |
| 1010 | ), |
| 1011 | ) |
| 1012 | ); |
| 1013 | |
| 1014 | $repeater->add_control( |
| 1015 | 'end_point', |
| 1016 | array( |
| 1017 | 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ), |
| 1018 | 'type' => Controls_Manager::SLIDER, |
| 1019 | 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ), |
| 1020 | 'default' => array( |
| 1021 | 'unit' => '%', |
| 1022 | 'size' => 0, |
| 1023 | ), |
| 1024 | 'condition' => array( |
| 1025 | 'icon_type' => array( 'icon', 'svg' ), |
| 1026 | 'draw_svg' => 'yes', |
| 1027 | 'lottie_reverse' => 'true', |
| 1028 | ), |
| 1029 | ) |
| 1030 | ); |
| 1031 | |
| 1032 | $repeater->add_control( |
| 1033 | 'svg_hover', |
| 1034 | array( |
| 1035 | 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ), |
| 1036 | 'type' => Controls_Manager::SWITCHER, |
| 1037 | 'return_value' => 'true', |
| 1038 | 'condition' => array( |
| 1039 | 'icon_type' => array( 'icon', 'svg' ), |
| 1040 | 'draw_svg' => 'yes', |
| 1041 | ), |
| 1042 | ) |
| 1043 | ); |
| 1044 | |
| 1045 | $repeater->add_control( |
| 1046 | 'svg_yoyo', |
| 1047 | array( |
| 1048 | 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ), |
| 1049 | 'type' => Controls_Manager::SWITCHER, |
| 1050 | 'condition' => array( |
| 1051 | 'icon_type' => array( 'icon', 'svg' ), |
| 1052 | 'draw_svg' => 'yes', |
| 1053 | 'lottie_loop' => 'true', |
| 1054 | ), |
| 1055 | ) |
| 1056 | ); |
| 1057 | } |
| 1058 | |
| 1059 | $repeater->add_control( |
| 1060 | 'premium_pricing_list_image', |
| 1061 | array( |
| 1062 | 'label' => __( 'Choose Image', 'premium-addons-for-elementor' ), |
| 1063 | 'type' => Controls_Manager::MEDIA, |
| 1064 | 'default' => array( |
| 1065 | 'url' => Utils::get_placeholder_image_src(), |
| 1066 | ), |
| 1067 | 'condition' => array( |
| 1068 | 'icon_type' => 'image', |
| 1069 | ), |
| 1070 | ) |
| 1071 | ); |
| 1072 | |
| 1073 | $repeater->add_control( |
| 1074 | 'premium_pricing_table_item_tooltip', |
| 1075 | array( |
| 1076 | 'label' => __( 'Tooltip', 'premium-addons-for-elementor' ), |
| 1077 | 'type' => Controls_Manager::SWITCHER, |
| 1078 | ) |
| 1079 | ); |
| 1080 | |
| 1081 | $repeater->add_control( |
| 1082 | 'premium_pricing_table_item_tooltip_text', |
| 1083 | array( |
| 1084 | 'label' => __( 'Tooltip Text', 'premium-addons-for-elementor' ), |
| 1085 | 'type' => Controls_Manager::TEXTAREA, |
| 1086 | 'dynamic' => array( 'active' => true ), |
| 1087 | 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', |
| 1088 | 'condition' => array( |
| 1089 | 'premium_pricing_table_item_tooltip' => 'yes', |
| 1090 | ), |
| 1091 | 'ai' => array( |
| 1092 | 'active' => false, |
| 1093 | ), |
| 1094 | ) |
| 1095 | ); |
| 1096 | |
| 1097 | $repeater->add_control( |
| 1098 | 'list_item_icon_color', |
| 1099 | array( |
| 1100 | 'label' => __( 'Icon Color', 'premium-addons-for-elementor' ), |
| 1101 | 'type' => Controls_Manager::COLOR, |
| 1102 | 'selectors' => array( |
| 1103 | '{{WRAPPER}} {{CURRENT_ITEM}} .premium-pricing-feature-icon' => 'color: {{VALUE}}', |
| 1104 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-drawable-icon *, {{WRAPPER}} {{CURRENT_ITEM}}.premium-pricing-list-item svg:not([class*="premium-"])' => 'fill: {{VALUE}} !important', |
| 1105 | ), |
| 1106 | 'condition' => array( |
| 1107 | 'icon_type' => 'icon', |
| 1108 | ), |
| 1109 | ) |
| 1110 | ); |
| 1111 | |
| 1112 | if ( $draw_icon ) { |
| 1113 | $repeater->add_control( |
| 1114 | 'stroke_color', |
| 1115 | array( |
| 1116 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1117 | 'type' => Controls_Manager::COLOR, |
| 1118 | 'default' => '#61CE70', |
| 1119 | 'condition' => array( |
| 1120 | 'icon_type' => array( 'icon', 'svg' ), |
| 1121 | ), |
| 1122 | 'selectors' => array( |
| 1123 | '{{WRAPPER}} {{CURRENT_ITEM}}.premium-drawable-icon *, {{WRAPPER}} {{CURRENT_ITEM}}.premium-pricing-list-item svg:not([class*="premium-"])' => 'stroke: {{VALUE}};', |
| 1124 | ), |
| 1125 | ) |
| 1126 | ); |
| 1127 | |
| 1128 | $repeater->add_control( |
| 1129 | 'svg_color', |
| 1130 | array( |
| 1131 | 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ), |
| 1132 | 'type' => Controls_Manager::COLOR, |
| 1133 | 'global' => false, |
| 1134 | 'condition' => array( |
| 1135 | 'icon_type' => array( 'icon', 'svg' ), |
| 1136 | 'draw_svg' => 'yes', |
| 1137 | ), |
| 1138 | ) |
| 1139 | ); |
| 1140 | } |
| 1141 | |
| 1142 | $repeater->add_control( |
| 1143 | 'list_item_text_color', |
| 1144 | array( |
| 1145 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 1146 | 'type' => Controls_Manager::COLOR, |
| 1147 | 'selectors' => array( |
| 1148 | '{{WRAPPER}} {{CURRENT_ITEM}} .premium-pricing-list-span' => 'color: {{VALUE}};', |
| 1149 | ), |
| 1150 | ) |
| 1151 | ); |
| 1152 | |
| 1153 | $this->add_control( |
| 1154 | 'premium_fancy_text_list_items', |
| 1155 | array( |
| 1156 | 'label' => __( 'Features', 'premium-addons-for-elementor' ), |
| 1157 | 'type' => Controls_Manager::REPEATER, |
| 1158 | 'default' => array( |
| 1159 | array( |
| 1160 | 'premium_pricing_list_item_icon_updated' => array( |
| 1161 | 'value' => 'fas fa-check', |
| 1162 | 'library' => 'fa-solid', |
| 1163 | ), |
| 1164 | 'premium_pricing_list_item_text' => __( 'List Item #1', 'premium-addons-for-elementor' ), |
| 1165 | ), |
| 1166 | array( |
| 1167 | 'premium_pricing_list_item_icon_updated' => array( |
| 1168 | 'value' => 'fas fa-check', |
| 1169 | 'library' => 'fa-solid', |
| 1170 | ), |
| 1171 | 'premium_pricing_list_item_text' => __( 'List Item #2', 'premium-addons-for-elementor' ), |
| 1172 | ), |
| 1173 | array( |
| 1174 | 'premium_pricing_list_item_icon_updated' => array( |
| 1175 | 'value' => 'fas fa-check', |
| 1176 | 'library' => 'fa-solid', |
| 1177 | ), |
| 1178 | 'premium_pricing_list_item_text' => __( 'List Item #3', 'premium-addons-for-elementor' ), |
| 1179 | ), |
| 1180 | ), |
| 1181 | 'fields' => $repeater->get_controls(), |
| 1182 | 'title_field' => '{{{ elementor.helpers.renderIcon( this, premium_pricing_list_item_icon_updated, {}, "i", "panel" ) || \'<i class="{{ premium_pricing_list_item_icon }}" aria-hidden="true"></i>\' }}} {{{ premium_pricing_list_item_text }}}', |
| 1183 | ) |
| 1184 | ); |
| 1185 | |
| 1186 | if ( $draw_icon ) { |
| 1187 | $this->add_control( |
| 1188 | 'draw_svgs_sequence', |
| 1189 | array( |
| 1190 | 'label' => __( 'Draw SVGs In Sequence', 'premium-addons-for-elementor' ), |
| 1191 | 'type' => Controls_Manager::SWITCHER, |
| 1192 | 'prefix_class' => 'pa-svg-draw-seq-', |
| 1193 | 'render_type' => 'template', |
| 1194 | ) |
| 1195 | ); |
| 1196 | |
| 1197 | $this->add_control( |
| 1198 | 'draw_svgs_loop', |
| 1199 | array( |
| 1200 | 'label' => __( 'Loop', 'premium-addons-for-elementor' ), |
| 1201 | 'type' => Controls_Manager::SWITCHER, |
| 1202 | 'prefix_class' => 'pa-svg-draw-loop-', |
| 1203 | 'render_type' => 'template', |
| 1204 | 'condition' => array( |
| 1205 | 'draw_svgs_sequence' => 'yes', |
| 1206 | ), |
| 1207 | ) |
| 1208 | ); |
| 1209 | |
| 1210 | $this->add_control( |
| 1211 | 'list_frames', |
| 1212 | array( |
| 1213 | 'label' => __( 'Speed', 'premium-addons-for-elementor' ), |
| 1214 | 'type' => Controls_Manager::NUMBER, |
| 1215 | 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ), |
| 1216 | 'default' => 5, |
| 1217 | 'min' => 1, |
| 1218 | 'max' => 100, |
| 1219 | 'condition' => array( |
| 1220 | 'draw_svgs_sequence' => 'yes', |
| 1221 | ), |
| 1222 | ) |
| 1223 | ); |
| 1224 | |
| 1225 | $this->add_control( |
| 1226 | 'list_svg_yoyo', |
| 1227 | array( |
| 1228 | 'label' => __( 'Yoyo Animation', 'premium-addons-for-elementor' ), |
| 1229 | 'type' => Controls_Manager::SWITCHER, |
| 1230 | 'prefix_class' => 'pa-svg-draw-yoyo-', |
| 1231 | 'render_type' => 'template', |
| 1232 | 'condition' => array( |
| 1233 | 'draw_svgs_sequence' => 'yes', |
| 1234 | 'draw_svgs_loop' => 'yes', |
| 1235 | ), |
| 1236 | ) |
| 1237 | ); |
| 1238 | } |
| 1239 | |
| 1240 | $this->add_responsive_control( |
| 1241 | 'premium_pricing_table_list_align', |
| 1242 | array( |
| 1243 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 1244 | 'type' => Controls_Manager::CHOOSE, |
| 1245 | 'separator' => 'before', |
| 1246 | 'options' => array( |
| 1247 | 'left' => array( |
| 1248 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1249 | 'icon' => 'eicon-text-align-left', |
| 1250 | ), |
| 1251 | 'center' => array( |
| 1252 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1253 | 'icon' => 'eicon-text-align-center', |
| 1254 | ), |
| 1255 | 'right' => array( |
| 1256 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1257 | 'icon' => 'eicon-text-align-right', |
| 1258 | ), |
| 1259 | ), |
| 1260 | 'prefix_class' => 'premium-pricing-features-', |
| 1261 | 'selectors_dictionary' => array( |
| 1262 | 'left' => 'start', |
| 1263 | 'center' => 'center', |
| 1264 | 'right' => 'end', |
| 1265 | ), |
| 1266 | 'toggle' => false, |
| 1267 | 'selectors' => array( |
| 1268 | '{{WRAPPER}} .premium-pricing-list .premium-pricing-list-item' => 'justify-content: {{VALUE}}', |
| 1269 | ), |
| 1270 | 'default' => 'center', |
| 1271 | ) |
| 1272 | ); |
| 1273 | |
| 1274 | $this->add_control( |
| 1275 | 'featured_order', |
| 1276 | array( |
| 1277 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 1278 | 'type' => Controls_Manager::NUMBER, |
| 1279 | 'separator' => 'before', |
| 1280 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 1281 | 'default' => 1, |
| 1282 | 'selectors' => array( |
| 1283 | '{{WRAPPER}} .premium-pricing-list' => 'order: {{VALUE}};', |
| 1284 | ), |
| 1285 | ) |
| 1286 | ); |
| 1287 | |
| 1288 | $this->end_controls_section(); |
| 1289 | } |
| 1290 | |
| 1291 | private function add_description_controls() { |
| 1292 | $this->start_controls_section( |
| 1293 | 'premium_pricing_table_description_section', |
| 1294 | array( |
| 1295 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 1296 | 'condition' => array( |
| 1297 | 'premium_pricing_table_description_switcher' => 'yes', |
| 1298 | ), |
| 1299 | ) |
| 1300 | ); |
| 1301 | |
| 1302 | $this->add_control( |
| 1303 | 'premium_pricing_table_description_text', |
| 1304 | array( |
| 1305 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 1306 | 'type' => Controls_Manager::WYSIWYG, |
| 1307 | 'dynamic' => array( 'active' => true ), |
| 1308 | 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', |
| 1309 | ) |
| 1310 | ); |
| 1311 | |
| 1312 | $this->add_control( |
| 1313 | 'description_order', |
| 1314 | array( |
| 1315 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 1316 | 'type' => Controls_Manager::NUMBER, |
| 1317 | 'separator' => 'before', |
| 1318 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 1319 | 'default' => 1, |
| 1320 | 'selectors' => array( |
| 1321 | '{{WRAPPER}} .premium-pricing-description-container ' => 'order: {{VALUE}};', |
| 1322 | ), |
| 1323 | ) |
| 1324 | ); |
| 1325 | |
| 1326 | $this->end_controls_section(); |
| 1327 | } |
| 1328 | |
| 1329 | private function add_button_controls() { |
| 1330 | $this->start_controls_section( |
| 1331 | 'premium_pricing_table_button_section', |
| 1332 | array( |
| 1333 | 'label' => __( 'Button', 'premium-addons-for-elementor' ), |
| 1334 | 'condition' => array( |
| 1335 | 'premium_pricing_table_button_switcher' => 'yes', |
| 1336 | ), |
| 1337 | ) |
| 1338 | ); |
| 1339 | |
| 1340 | $this->add_control( |
| 1341 | 'premium_pricing_table_button_text', |
| 1342 | array( |
| 1343 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 1344 | 'default' => __( 'Get Started', 'premium-addons-for-elementor' ), |
| 1345 | 'type' => Controls_Manager::TEXT, |
| 1346 | 'dynamic' => array( 'active' => true ), |
| 1347 | 'label_block' => true, |
| 1348 | 'ai' => array( |
| 1349 | 'active' => false, |
| 1350 | ), |
| 1351 | ) |
| 1352 | ); |
| 1353 | |
| 1354 | $this->add_control( |
| 1355 | 'premium_pricing_table_button_url_type', |
| 1356 | array( |
| 1357 | 'label' => __( 'Link Type', 'premium-addons-for-elementor' ), |
| 1358 | 'type' => Controls_Manager::SELECT, |
| 1359 | 'options' => array( |
| 1360 | 'url' => __( 'URL', 'premium-addons-for-elementor' ), |
| 1361 | 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 1362 | ), |
| 1363 | 'default' => 'url', |
| 1364 | 'label_block' => true, |
| 1365 | ) |
| 1366 | ); |
| 1367 | |
| 1368 | $this->add_control( |
| 1369 | 'premium_pricing_table_button_link', |
| 1370 | array( |
| 1371 | 'label' => __( 'Link', 'premium-addons-for-elementor' ), |
| 1372 | 'type' => Controls_Manager::URL, |
| 1373 | 'dynamic' => array( 'active' => true ), |
| 1374 | 'condition' => array( |
| 1375 | 'premium_pricing_table_button_url_type' => 'url', |
| 1376 | ), |
| 1377 | 'label_block' => true, |
| 1378 | ) |
| 1379 | ); |
| 1380 | |
| 1381 | $this->add_control( |
| 1382 | 'premium_pricing_table_button_link_existing_content', |
| 1383 | array( |
| 1384 | 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ), |
| 1385 | 'type' => Premium_Post_Filter::TYPE, |
| 1386 | 'label_block' => true, |
| 1387 | 'multiple' => false, |
| 1388 | 'source' => array( 'post', 'page' ), |
| 1389 | 'condition' => array( |
| 1390 | 'premium_pricing_table_button_url_type' => 'link', |
| 1391 | ), |
| 1392 | ) |
| 1393 | ); |
| 1394 | |
| 1395 | $this->add_responsive_control( |
| 1396 | 'button_width', |
| 1397 | array( |
| 1398 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 1399 | 'type' => Controls_Manager::SLIDER, |
| 1400 | 'size_units' => array( 'px', '%', 'custom' ), |
| 1401 | 'range' => array( |
| 1402 | 'px' => array( |
| 1403 | 'min' => 1, |
| 1404 | 'max' => 500, |
| 1405 | ), |
| 1406 | ), |
| 1407 | 'default' => array( |
| 1408 | 'size' => 100, |
| 1409 | 'unit' => '%', |
| 1410 | ), |
| 1411 | 'selectors' => array( |
| 1412 | '{{WRAPPER}} .premium-pricing-price-button' => 'width: {{SIZE}}{{UNIT}};', |
| 1413 | ), |
| 1414 | ) |
| 1415 | ); |
| 1416 | |
| 1417 | Helper_Functions::add_btn_hover_controls( $this, array() ); |
| 1418 | |
| 1419 | $this->add_control( |
| 1420 | 'btn_order', |
| 1421 | array( |
| 1422 | 'label' => __( 'Order', 'premium-addons-for-elementor' ), |
| 1423 | 'type' => Controls_Manager::NUMBER, |
| 1424 | 'default' => 1, |
| 1425 | 'separator' => 'before', |
| 1426 | 'description' => __( 'Set the display order of this element. Elements with lower order numbers will appear before those with higher numbers. Default is 1.', 'premium-addons-for-elementor' ), |
| 1427 | 'selectors' => array( |
| 1428 | '{{WRAPPER}} .premium-pricing-button-container ' => 'order: {{VALUE}};', |
| 1429 | ), |
| 1430 | ) |
| 1431 | ); |
| 1432 | |
| 1433 | $this->end_controls_section(); |
| 1434 | } |
| 1435 | |
| 1436 | private function add_ribbon_controls() { |
| 1437 | $this->start_controls_section( |
| 1438 | 'premium_pricing_table_ribbon_section', |
| 1439 | array( |
| 1440 | 'label' => __( 'Ribbon', 'premium-addons-for-elementor' ), |
| 1441 | 'condition' => array( |
| 1442 | 'premium_pricing_table_badge_switcher' => 'yes', |
| 1443 | ), |
| 1444 | ) |
| 1445 | ); |
| 1446 | |
| 1447 | $this->add_control( |
| 1448 | 'ribbon_type', |
| 1449 | array( |
| 1450 | 'label' => __( 'Type', 'premium-addons-for-elementor' ), |
| 1451 | 'type' => Controls_Manager::SELECT, |
| 1452 | 'options' => array( |
| 1453 | 'triangle' => __( 'Triangle', 'premium-addons-for-elementor' ), |
| 1454 | 'circle' => __( 'Circle', 'premium-addons-for-elementor' ), |
| 1455 | 'stripe' => __( 'Stripe', 'premium-addons-for-elementor' ), |
| 1456 | 'flag' => __( 'Flag', 'premium-addons-for-elementor' ), |
| 1457 | ), |
| 1458 | 'default' => 'triangle', |
| 1459 | ) |
| 1460 | ); |
| 1461 | |
| 1462 | $this->add_control( |
| 1463 | 'premium_pricing_table_badge_text', |
| 1464 | array( |
| 1465 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 1466 | 'default' => __( 'NEW', 'premium-addons-for-elementor' ), |
| 1467 | 'type' => Controls_Manager::TEXT, |
| 1468 | 'dynamic' => array( 'active' => true ), |
| 1469 | 'label_block' => true, |
| 1470 | 'ai' => array( |
| 1471 | 'active' => false, |
| 1472 | ), |
| 1473 | ) |
| 1474 | ); |
| 1475 | |
| 1476 | $this->add_responsive_control( |
| 1477 | 'premium_pricing_table_badge_left_size', |
| 1478 | array( |
| 1479 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1480 | 'type' => Controls_Manager::SLIDER, |
| 1481 | 'range' => array( |
| 1482 | 'px' => array( |
| 1483 | 'min' => 1, |
| 1484 | 'max' => 300, |
| 1485 | ), |
| 1486 | ), |
| 1487 | 'selectors' => array( |
| 1488 | '{{WRAPPER}} .premium-badge-triangle.premium-badge-left .corner' => 'border-top-width: {{SIZE}}px; border-bottom-width: {{SIZE}}px; border-right-width: {{SIZE}}px;', |
| 1489 | ), |
| 1490 | 'condition' => array( |
| 1491 | 'ribbon_type' => 'triangle', |
| 1492 | 'premium_pricing_table_badge_position' => 'left', |
| 1493 | ), |
| 1494 | ) |
| 1495 | ); |
| 1496 | |
| 1497 | $this->add_responsive_control( |
| 1498 | 'premium_pricing_table_badge_right_size', |
| 1499 | array( |
| 1500 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1501 | 'type' => Controls_Manager::SLIDER, |
| 1502 | 'range' => array( |
| 1503 | 'px' => array( |
| 1504 | 'min' => 1, |
| 1505 | 'max' => 300, |
| 1506 | ), |
| 1507 | ), |
| 1508 | 'selectors' => array( |
| 1509 | '{{WRAPPER}} .premium-badge-triangle.premium-badge-right .corner' => 'border-right-width: {{SIZE}}px; border-bottom-width: {{SIZE}}px; border-left-width: {{SIZE}}px;', |
| 1510 | ), |
| 1511 | 'condition' => array( |
| 1512 | 'ribbon_type' => 'triangle', |
| 1513 | 'premium_pricing_table_badge_position' => 'right', |
| 1514 | ), |
| 1515 | ) |
| 1516 | ); |
| 1517 | |
| 1518 | $this->add_responsive_control( |
| 1519 | 'circle_ribbon_size', |
| 1520 | array( |
| 1521 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1522 | 'type' => Controls_Manager::SLIDER, |
| 1523 | 'range' => array( |
| 1524 | 'px' => array( |
| 1525 | 'min' => 1, |
| 1526 | 'max' => 10, |
| 1527 | ), |
| 1528 | ), |
| 1529 | 'selectors' => array( |
| 1530 | '{{WRAPPER}} .premium-badge-circle' => 'min-width: {{SIZE}}em; min-height: {{SIZE}}em; line-height: {{SIZE}}', |
| 1531 | ), |
| 1532 | 'condition' => array( |
| 1533 | 'ribbon_type' => 'circle', |
| 1534 | ), |
| 1535 | ) |
| 1536 | ); |
| 1537 | |
| 1538 | if ( ! is_rtl() ) { |
| 1539 | |
| 1540 | $this->add_control( |
| 1541 | 'premium_pricing_table_badge_position', |
| 1542 | array( |
| 1543 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 1544 | 'type' => Controls_Manager::CHOOSE, |
| 1545 | 'toggle' => false, |
| 1546 | 'options' => array( |
| 1547 | 'left' => array( |
| 1548 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1549 | 'icon' => 'eicon-h-align-left', |
| 1550 | ), |
| 1551 | 'right' => array( |
| 1552 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1553 | 'icon' => 'eicon-h-align-right', |
| 1554 | ), |
| 1555 | ), |
| 1556 | 'default' => 'right', |
| 1557 | ) |
| 1558 | ); |
| 1559 | |
| 1560 | } else { |
| 1561 | $this->add_control( |
| 1562 | 'premium_pricing_table_badge_position', |
| 1563 | array( |
| 1564 | 'label' => __( 'Position', 'premium-addons-for-elementor' ), |
| 1565 | 'type' => Controls_Manager::CHOOSE, |
| 1566 | 'toggle' => false, |
| 1567 | 'options' => array( |
| 1568 | 'left' => array( |
| 1569 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1570 | 'icon' => 'eicon-h-align-left', |
| 1571 | ), |
| 1572 | 'right' => array( |
| 1573 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1574 | 'icon' => 'eicon-h-align-right', |
| 1575 | ), |
| 1576 | ), |
| 1577 | 'default' => 'right', |
| 1578 | 'condition' => array( |
| 1579 | 'ribbon_type!' => 'flag', |
| 1580 | ), |
| 1581 | ) |
| 1582 | ); |
| 1583 | } |
| 1584 | |
| 1585 | $this->add_responsive_control( |
| 1586 | 'premium_pricing_table_badge_right_right', |
| 1587 | array( |
| 1588 | 'label' => __( 'Horizontal Offset', 'premium-addons-for-elementor' ), |
| 1589 | 'type' => Controls_Manager::SLIDER, |
| 1590 | 'size_units' => array( 'px', 'em', '%' ), |
| 1591 | 'range' => array( |
| 1592 | 'px' => array( |
| 1593 | 'min' => 1, |
| 1594 | 'max' => 170, |
| 1595 | ), |
| 1596 | 'em' => array( |
| 1597 | 'min' => 1, |
| 1598 | 'max' => 30, |
| 1599 | ), |
| 1600 | ), |
| 1601 | 'selectors' => array( |
| 1602 | '{{WRAPPER}} .premium-badge-right .corner span' => 'right: {{SIZE}}{{UNIT}}', |
| 1603 | '{{WRAPPER}} .premium-badge-circle' => 'right: {{SIZE}}{{UNIT}}', |
| 1604 | ), |
| 1605 | 'condition' => array( |
| 1606 | 'ribbon_type!' => array( 'stripe', 'flag' ), |
| 1607 | 'premium_pricing_table_badge_position' => 'right', |
| 1608 | ), |
| 1609 | ) |
| 1610 | ); |
| 1611 | |
| 1612 | $this->add_responsive_control( |
| 1613 | 'premium_pricing_table_badge_right_left', |
| 1614 | array( |
| 1615 | 'label' => __( 'Horizontal Offset', 'premium-addons-for-elementor' ), |
| 1616 | 'type' => Controls_Manager::SLIDER, |
| 1617 | 'size_units' => array( 'px', 'em', '%' ), |
| 1618 | 'range' => array( |
| 1619 | 'px' => array( |
| 1620 | 'min' => 1, |
| 1621 | 'max' => 170, |
| 1622 | ), |
| 1623 | 'em' => array( |
| 1624 | 'min' => 1, |
| 1625 | 'max' => 30, |
| 1626 | ), |
| 1627 | ), |
| 1628 | 'selectors' => array( |
| 1629 | '{{WRAPPER}} .premium-badge-left .corner span' => 'left: {{SIZE}}{{UNIT}}', |
| 1630 | '{{WRAPPER}} .premium-badge-circle' => 'left: {{SIZE}}{{UNIT}}', |
| 1631 | ), |
| 1632 | 'condition' => array( |
| 1633 | 'ribbon_type!' => array( 'stripe', 'flag' ), |
| 1634 | 'premium_pricing_table_badge_position' => 'left', |
| 1635 | ), |
| 1636 | ) |
| 1637 | ); |
| 1638 | |
| 1639 | $this->add_responsive_control( |
| 1640 | 'premium_pricing_table_badge_right_top', |
| 1641 | array( |
| 1642 | 'label' => __( 'Vertical Offset', 'premium-addons-for-elementor' ), |
| 1643 | 'type' => Controls_Manager::SLIDER, |
| 1644 | 'size_units' => array( 'px', 'em', '%' ), |
| 1645 | 'range' => array( |
| 1646 | 'px' => array( |
| 1647 | 'min' => 1, |
| 1648 | 'max' => 200, |
| 1649 | ), |
| 1650 | 'em' => array( |
| 1651 | 'min' => 1, |
| 1652 | 'max' => 20, |
| 1653 | ), |
| 1654 | ), |
| 1655 | 'condition' => array( |
| 1656 | 'ribbon_type!' => 'stripe', |
| 1657 | ), |
| 1658 | 'selectors' => array( |
| 1659 | '{{WRAPPER}} .premium-pricing-badge-container .corner span' => 'top: {{SIZE}}{{UNIT}}', |
| 1660 | '{{WRAPPER}} .premium-badge-circle, {{WRAPPER}} .premium-badge-flag .corner' => 'top: {{SIZE}}{{UNIT}}', |
| 1661 | ), |
| 1662 | ) |
| 1663 | ); |
| 1664 | |
| 1665 | $this->end_controls_section(); |
| 1666 | } |
| 1667 | |
| 1668 | private function add_display_option_controls() { |
| 1669 | $this->start_controls_section( |
| 1670 | 'premium_pricing_table_title', |
| 1671 | array( |
| 1672 | 'label' => __( 'Display Options', 'premium-addons-for-elementor' ), |
| 1673 | ) |
| 1674 | ); |
| 1675 | |
| 1676 | $this->add_control( |
| 1677 | 'premium_pricing_table_icon_switcher', |
| 1678 | array( |
| 1679 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 1680 | 'type' => Controls_Manager::SWITCHER, |
| 1681 | ) |
| 1682 | ); |
| 1683 | |
| 1684 | $this->add_control( |
| 1685 | 'premium_pricing_table_title_switcher', |
| 1686 | array( |
| 1687 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 1688 | 'type' => Controls_Manager::SWITCHER, |
| 1689 | 'default' => 'yes', |
| 1690 | ) |
| 1691 | ); |
| 1692 | |
| 1693 | $this->add_control( |
| 1694 | 'premium_pricing_table_price_switcher', |
| 1695 | array( |
| 1696 | 'label' => __( 'Price', 'premium-addons-for-elementor' ), |
| 1697 | 'type' => Controls_Manager::SWITCHER, |
| 1698 | 'default' => 'yes', |
| 1699 | ) |
| 1700 | ); |
| 1701 | |
| 1702 | $this->add_control( |
| 1703 | 'premium_pricing_table_list_switcher', |
| 1704 | array( |
| 1705 | 'label' => __( 'Features', 'premium-addons-for-elementor' ), |
| 1706 | 'type' => Controls_Manager::SWITCHER, |
| 1707 | 'default' => 'yes', |
| 1708 | ) |
| 1709 | ); |
| 1710 | |
| 1711 | $this->add_control( |
| 1712 | 'premium_pricing_table_description_switcher', |
| 1713 | array( |
| 1714 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 1715 | 'type' => Controls_Manager::SWITCHER, |
| 1716 | ) |
| 1717 | ); |
| 1718 | |
| 1719 | $this->add_control( |
| 1720 | 'premium_pricing_table_button_switcher', |
| 1721 | array( |
| 1722 | 'label' => __( 'Button', 'premium-addons-for-elementor' ), |
| 1723 | 'type' => Controls_Manager::SWITCHER, |
| 1724 | 'default' => 'yes', |
| 1725 | ) |
| 1726 | ); |
| 1727 | |
| 1728 | $this->add_control( |
| 1729 | 'premium_pricing_table_badge_switcher', |
| 1730 | array( |
| 1731 | 'label' => __( 'Ribbon', 'premium-addons-for-elementor' ), |
| 1732 | 'type' => Controls_Manager::SWITCHER, |
| 1733 | 'default' => 'yes', |
| 1734 | ) |
| 1735 | ); |
| 1736 | |
| 1737 | $this->add_responsive_control( |
| 1738 | 'pa_pt_alignment', |
| 1739 | array( |
| 1740 | 'label' => __( 'Content Alignment', 'premium-addons-for-elementor' ), |
| 1741 | 'type' => Controls_Manager::CHOOSE, |
| 1742 | 'separator' => 'before', |
| 1743 | 'options' => array( |
| 1744 | 'left' => array( |
| 1745 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 1746 | 'icon' => 'eicon-text-align-left', |
| 1747 | ), |
| 1748 | 'center' => array( |
| 1749 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 1750 | 'icon' => 'eicon-text-align-center', |
| 1751 | ), |
| 1752 | 'right' => array( |
| 1753 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 1754 | 'icon' => 'eicon-text-align-right', |
| 1755 | ), |
| 1756 | ), |
| 1757 | 'selectors_dictionary' => array( |
| 1758 | 'left' => 'start', |
| 1759 | 'center' => 'center', |
| 1760 | 'right' => 'end', |
| 1761 | ), |
| 1762 | 'toggle' => false, |
| 1763 | 'selectors' => array( |
| 1764 | '{{WRAPPER}} .premium-pricing-price-container, {{WRAPPER}} .premium-pricing-icon-container' => 'justify-content: {{VALUE}}', |
| 1765 | '{{WRAPPER}} .premium-pricing-list' => 'justify-self: {{VALUE}}', |
| 1766 | '{{WRAPPER}} .premium-pricing-table-container' => 'text-align: {{VALUE}}', |
| 1767 | ), |
| 1768 | 'default' => 'center', |
| 1769 | ) |
| 1770 | ); |
| 1771 | |
| 1772 | $this->end_controls_section(); |
| 1773 | } |
| 1774 | |
| 1775 | private function add_icon_style_controls( $draw_icon ) { |
| 1776 | $this->start_controls_section( |
| 1777 | 'premium_pricing_icon_style_settings', |
| 1778 | array( |
| 1779 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 1780 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1781 | 'condition' => array( |
| 1782 | 'premium_pricing_table_icon_switcher' => 'yes', |
| 1783 | ), |
| 1784 | ) |
| 1785 | ); |
| 1786 | |
| 1787 | $this->add_control( |
| 1788 | 'premium_pricing_icon_color', |
| 1789 | array( |
| 1790 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 1791 | 'type' => Controls_Manager::COLOR, |
| 1792 | 'global' => array( |
| 1793 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 1794 | ), |
| 1795 | 'selectors' => array( |
| 1796 | '{{WRAPPER}} .premium-pricing-icon-container i' => 'color: {{VALUE}};', |
| 1797 | '{{WRAPPER}} .premium-pricing-icon-container .premium-drawable-icon *, {{WRAPPER}} .premium-pricing-icon-container svg:not([class*="premium-"])' => 'fill: {{VALUE}};', |
| 1798 | ), |
| 1799 | 'condition' => array( |
| 1800 | 'icon_type' => 'icon', |
| 1801 | ), |
| 1802 | ) |
| 1803 | ); |
| 1804 | |
| 1805 | if ( $draw_icon ) { |
| 1806 | $this->add_control( |
| 1807 | 'stroke_color', |
| 1808 | array( |
| 1809 | 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ), |
| 1810 | 'type' => Controls_Manager::COLOR, |
| 1811 | 'global' => array( |
| 1812 | 'default' => Global_Colors::COLOR_ACCENT, |
| 1813 | ), |
| 1814 | 'condition' => array( |
| 1815 | 'icon_type' => array( 'icon', 'svg' ), |
| 1816 | ), |
| 1817 | 'selectors' => array( |
| 1818 | '{{WRAPPER}} .premium-pricing-icon-container .premium-drawable-icon *, {{WRAPPER}} .premium-pricing-icon-container svg:not([class*="premium-"])' => 'stroke: {{VALUE}};', |
| 1819 | ), |
| 1820 | ) |
| 1821 | ); |
| 1822 | |
| 1823 | $this->add_control( |
| 1824 | 'svg_color', |
| 1825 | array( |
| 1826 | 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ), |
| 1827 | 'type' => Controls_Manager::COLOR, |
| 1828 | 'global' => false, |
| 1829 | 'condition' => array( |
| 1830 | 'icon_type' => array( 'icon', 'svg' ), |
| 1831 | 'draw_svg' => 'yes', |
| 1832 | ), |
| 1833 | ) |
| 1834 | ); |
| 1835 | } |
| 1836 | |
| 1837 | $this->add_responsive_control( |
| 1838 | 'premium_pricing_icon_size', |
| 1839 | array( |
| 1840 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 1841 | 'type' => Controls_Manager::SLIDER, |
| 1842 | 'size_units' => array( 'px', '%', 'em' ), |
| 1843 | 'default' => array( |
| 1844 | 'size' => 25, |
| 1845 | 'unit' => 'px', |
| 1846 | ), |
| 1847 | 'condition' => array( |
| 1848 | 'icon_type!' => 'svg', |
| 1849 | ), |
| 1850 | 'selectors' => array( |
| 1851 | '{{WRAPPER}} .premium-pricing-icon-container i' => 'font-size: {{SIZE}}{{UNIT}}', |
| 1852 | '{{WRAPPER}} .premium-pricing-icon-container svg, {{WRAPPER}} .premium-pricing-icon-container img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important', |
| 1853 | ), |
| 1854 | ) |
| 1855 | ); |
| 1856 | |
| 1857 | $this->add_responsive_control( |
| 1858 | 'svg_icon_width', |
| 1859 | array( |
| 1860 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 1861 | 'type' => Controls_Manager::SLIDER, |
| 1862 | 'size_units' => array( 'px', 'em', '%' ), |
| 1863 | 'range' => array( |
| 1864 | 'px' => array( |
| 1865 | 'min' => 1, |
| 1866 | 'max' => 600, |
| 1867 | ), |
| 1868 | 'em' => array( |
| 1869 | 'min' => 1, |
| 1870 | 'max' => 30, |
| 1871 | ), |
| 1872 | ), |
| 1873 | 'default' => array( |
| 1874 | 'size' => 100, |
| 1875 | 'unit' => 'px', |
| 1876 | ), |
| 1877 | 'condition' => array( |
| 1878 | 'icon_type' => 'svg', |
| 1879 | ), |
| 1880 | 'selectors' => array( |
| 1881 | '{{WRAPPER}} .premium-pricing-icon-container svg' => 'width: {{SIZE}}{{UNIT}};', |
| 1882 | ), |
| 1883 | ) |
| 1884 | ); |
| 1885 | |
| 1886 | $this->add_responsive_control( |
| 1887 | 'svg_icon_height', |
| 1888 | array( |
| 1889 | 'label' => __( 'Height', 'premium-addons-for-elementor' ), |
| 1890 | 'type' => Controls_Manager::SLIDER, |
| 1891 | 'size_units' => array( 'px', 'em' ), |
| 1892 | 'range' => array( |
| 1893 | 'px' => array( |
| 1894 | 'min' => 1, |
| 1895 | 'max' => 300, |
| 1896 | ), |
| 1897 | 'em' => array( |
| 1898 | 'min' => 1, |
| 1899 | 'max' => 30, |
| 1900 | ), |
| 1901 | ), |
| 1902 | 'condition' => array( |
| 1903 | 'icon_type' => 'svg', |
| 1904 | ), |
| 1905 | 'selectors' => array( |
| 1906 | '{{WRAPPER}} .premium-pricing-icon-container svg' => 'height: {{SIZE}}{{UNIT}}', |
| 1907 | ), |
| 1908 | ) |
| 1909 | ); |
| 1910 | |
| 1911 | $this->add_control( |
| 1912 | 'premium_pricing_icon_back_color', |
| 1913 | array( |
| 1914 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 1915 | 'type' => Controls_Manager::COLOR, |
| 1916 | 'global' => array( |
| 1917 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 1918 | ), |
| 1919 | 'selectors' => array( |
| 1920 | '{{WRAPPER}} .premium-pricing-icon-wrapper' => 'background-color: {{VALUE}};', |
| 1921 | ), |
| 1922 | ) |
| 1923 | ); |
| 1924 | |
| 1925 | $this->add_responsive_control( |
| 1926 | 'premium_pricing_icon_inner_padding', |
| 1927 | array( |
| 1928 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 1929 | 'type' => Controls_Manager::SLIDER, |
| 1930 | 'size_units' => array( 'px', 'em' ), |
| 1931 | 'default' => array( |
| 1932 | 'size' => 5, |
| 1933 | 'unit' => 'px', |
| 1934 | ), |
| 1935 | 'selectors' => array( |
| 1936 | '{{WRAPPER}} .premium-pricing-icon-wrapper' => 'padding: {{SIZE}}{{UNIT}};', |
| 1937 | ), |
| 1938 | ) |
| 1939 | ); |
| 1940 | |
| 1941 | $this->add_group_control( |
| 1942 | Group_Control_Border::get_type(), |
| 1943 | array( |
| 1944 | 'name' => 'premium_pricing_icon_inner_border', |
| 1945 | 'selector' => '{{WRAPPER}} .premium-pricing-icon-wrapper', |
| 1946 | ) |
| 1947 | ); |
| 1948 | |
| 1949 | $this->add_control( |
| 1950 | 'premium_pricing_icon_inner_radius', |
| 1951 | array( |
| 1952 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1953 | 'type' => Controls_Manager::SLIDER, |
| 1954 | 'size_units' => array( 'px', '%', 'em' ), |
| 1955 | 'default' => array( |
| 1956 | 'size' => 100, |
| 1957 | 'unit' => 'px', |
| 1958 | ), |
| 1959 | 'selectors' => array( |
| 1960 | '{{WRAPPER}} .premium-pricing-icon-wrapper' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1961 | ), |
| 1962 | 'separator' => 'after', |
| 1963 | ) |
| 1964 | ); |
| 1965 | |
| 1966 | $this->add_control( |
| 1967 | 'premium_pricing_icon_container_heading', |
| 1968 | array( |
| 1969 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 1970 | 'type' => Controls_Manager::HEADING, |
| 1971 | ) |
| 1972 | ); |
| 1973 | |
| 1974 | $this->add_group_control( |
| 1975 | Premium_Background::get_type(), |
| 1976 | array( |
| 1977 | 'name' => 'premium_pricing_table_icon_background', |
| 1978 | 'types' => array( 'classic', 'gradient' ), |
| 1979 | 'selector' => '{{WRAPPER}} .premium-pricing-icon-container', |
| 1980 | ) |
| 1981 | ); |
| 1982 | |
| 1983 | $this->add_group_control( |
| 1984 | Group_Control_Border::get_type(), |
| 1985 | array( |
| 1986 | 'name' => 'premium_pricing_icon_border', |
| 1987 | 'selector' => '{{WRAPPER}} .premium-pricing-icon-container', |
| 1988 | ) |
| 1989 | ); |
| 1990 | |
| 1991 | $this->add_control( |
| 1992 | 'premium_pricing_icon_border_radius', |
| 1993 | array( |
| 1994 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 1995 | 'type' => Controls_Manager::SLIDER, |
| 1996 | 'size_units' => array( 'px', '%', 'em' ), |
| 1997 | 'selectors' => array( |
| 1998 | '{{WRAPPER}} .premium-pricing-icon-container' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 1999 | ), |
| 2000 | ) |
| 2001 | ); |
| 2002 | |
| 2003 | $this->add_responsive_control( |
| 2004 | 'premium_pricing_icon_padding', |
| 2005 | array( |
| 2006 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2007 | 'type' => Controls_Manager::DIMENSIONS, |
| 2008 | 'size_units' => array( 'px', 'em', '%' ), |
| 2009 | 'default' => array( |
| 2010 | 'top' => 0, |
| 2011 | 'right' => 0, |
| 2012 | 'bottom' => 0, |
| 2013 | 'left' => 0, |
| 2014 | 'unit' => 'px', |
| 2015 | ), |
| 2016 | 'selectors' => array( |
| 2017 | '{{WRAPPER}} .premium-pricing-icon-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2018 | ), |
| 2019 | ) |
| 2020 | ); |
| 2021 | |
| 2022 | $this->add_responsive_control( |
| 2023 | 'premium_pricing_icon_margin', |
| 2024 | array( |
| 2025 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2026 | 'type' => Controls_Manager::DIMENSIONS, |
| 2027 | 'size_units' => array( 'px', 'em', '%' ), |
| 2028 | 'default' => array( |
| 2029 | 'top' => 50, |
| 2030 | 'right' => 0, |
| 2031 | 'bottom' => 20, |
| 2032 | 'left' => 0, |
| 2033 | 'unit' => 'px', |
| 2034 | ), |
| 2035 | 'selectors' => array( |
| 2036 | '{{WRAPPER}} .premium-pricing-icon-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2037 | ), |
| 2038 | ) |
| 2039 | ); |
| 2040 | |
| 2041 | $this->end_controls_section(); |
| 2042 | } |
| 2043 | |
| 2044 | private function add_title_style_controls() { |
| 2045 | $this->start_controls_section( |
| 2046 | 'premium_pricing_title_style_settings', |
| 2047 | array( |
| 2048 | 'label' => __( 'Title', 'premium-addons-for-elementor' ), |
| 2049 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2050 | 'condition' => array( |
| 2051 | 'premium_pricing_table_title_switcher' => 'yes', |
| 2052 | ), |
| 2053 | ) |
| 2054 | ); |
| 2055 | |
| 2056 | $this->add_control( |
| 2057 | 'premium_pricing_title_color', |
| 2058 | array( |
| 2059 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2060 | 'type' => Controls_Manager::COLOR, |
| 2061 | 'global' => array( |
| 2062 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2063 | ), |
| 2064 | 'selectors' => array( |
| 2065 | '{{WRAPPER}} .premium-pricing-table-title' => 'color: {{VALUE}};', |
| 2066 | ), |
| 2067 | ) |
| 2068 | ); |
| 2069 | |
| 2070 | $this->add_group_control( |
| 2071 | Group_Control_Typography::get_type(), |
| 2072 | array( |
| 2073 | 'name' => 'title_typo', |
| 2074 | 'global' => array( |
| 2075 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2076 | ), |
| 2077 | 'selector' => '{{WRAPPER}} .premium-pricing-table-title', |
| 2078 | ) |
| 2079 | ); |
| 2080 | |
| 2081 | $this->add_group_control( |
| 2082 | Premium_Background::get_type(), |
| 2083 | array( |
| 2084 | 'name' => 'premium_pricing_table_title_background', |
| 2085 | 'types' => array( 'classic', 'gradient' ), |
| 2086 | 'selector' => '{{WRAPPER}} .premium-pricing-table-title', |
| 2087 | ) |
| 2088 | ); |
| 2089 | |
| 2090 | $this->add_responsive_control( |
| 2091 | 'premium_pricing_title_padding', |
| 2092 | array( |
| 2093 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2094 | 'type' => Controls_Manager::DIMENSIONS, |
| 2095 | 'size_units' => array( 'px', 'em', '%' ), |
| 2096 | 'selectors' => array( |
| 2097 | '{{WRAPPER}} .premium-pricing-table-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2098 | ), |
| 2099 | ) |
| 2100 | ); |
| 2101 | |
| 2102 | $this->add_responsive_control( |
| 2103 | 'premium_pricing_title_margin', |
| 2104 | array( |
| 2105 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2106 | 'type' => Controls_Manager::DIMENSIONS, |
| 2107 | 'size_units' => array( 'px', 'em', '%' ), |
| 2108 | 'selectors' => array( |
| 2109 | '{{WRAPPER}} .premium-pricing-table-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2110 | ), |
| 2111 | ) |
| 2112 | ); |
| 2113 | |
| 2114 | $this->end_controls_section(); |
| 2115 | } |
| 2116 | |
| 2117 | private function add_price_style_controls() { |
| 2118 | |
| 2119 | $this->start_controls_section( |
| 2120 | 'premium_pricing_price_style_settings', |
| 2121 | array( |
| 2122 | 'label' => __( 'Price', 'premium-addons-for-elementor' ), |
| 2123 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2124 | 'condition' => array( |
| 2125 | 'premium_pricing_table_price_switcher' => 'yes', |
| 2126 | ), |
| 2127 | ) |
| 2128 | ); |
| 2129 | |
| 2130 | $this->add_control( |
| 2131 | 'premium_pricing_slashed_price_heading', |
| 2132 | array( |
| 2133 | 'label' => __( 'Slashed Price', 'premium-addons-for-elementor' ), |
| 2134 | 'type' => Controls_Manager::HEADING, |
| 2135 | ) |
| 2136 | ); |
| 2137 | |
| 2138 | $this->add_control( |
| 2139 | 'premium_pricing_slashed_price_color', |
| 2140 | array( |
| 2141 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2142 | 'type' => Controls_Manager::COLOR, |
| 2143 | 'global' => array( |
| 2144 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2145 | ), |
| 2146 | 'selectors' => array( |
| 2147 | '{{WRAPPER}} .premium-pricing-slashed-price-value' => 'color: {{VALUE}};', |
| 2148 | ), |
| 2149 | ) |
| 2150 | ); |
| 2151 | |
| 2152 | $this->add_group_control( |
| 2153 | Group_Control_Typography::get_type(), |
| 2154 | array( |
| 2155 | 'name' => 'slashed_price_typo', |
| 2156 | 'global' => array( |
| 2157 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2158 | ), |
| 2159 | 'selector' => '{{WRAPPER}} .premium-pricing-slashed-price-value', |
| 2160 | 'condition' => array( |
| 2161 | 'price_effects!' => 'effect-1', |
| 2162 | ), |
| 2163 | ) |
| 2164 | ); |
| 2165 | |
| 2166 | $this->add_responsive_control( |
| 2167 | 'premium_pricing_slashed_price_margin', |
| 2168 | array( |
| 2169 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2170 | 'type' => Controls_Manager::DIMENSIONS, |
| 2171 | 'size_units' => array( 'px', 'em', '%' ), |
| 2172 | 'selectors' => array( |
| 2173 | '{{WRAPPER}} .premium-pricing--slashed-price-value' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2174 | ), |
| 2175 | 'condition' => array( |
| 2176 | 'price_effects!' => 'effect-1', |
| 2177 | ), |
| 2178 | ) |
| 2179 | ); |
| 2180 | |
| 2181 | $this->add_control( |
| 2182 | 'premium_pricing_currency_heading', |
| 2183 | array( |
| 2184 | 'label' => __( 'Currency', 'premium-addons-for-elementor' ), |
| 2185 | 'type' => Controls_Manager::HEADING, |
| 2186 | 'separator' => 'before', |
| 2187 | ) |
| 2188 | ); |
| 2189 | |
| 2190 | $this->add_control( |
| 2191 | 'premium_pricing_currency_color', |
| 2192 | array( |
| 2193 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2194 | 'type' => Controls_Manager::COLOR, |
| 2195 | 'global' => array( |
| 2196 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2197 | ), |
| 2198 | 'selectors' => array( |
| 2199 | '{{WRAPPER}} .premium-pricing-price-currency' => 'color: {{VALUE}};', |
| 2200 | ), |
| 2201 | ) |
| 2202 | ); |
| 2203 | |
| 2204 | $this->add_group_control( |
| 2205 | Group_Control_Typography::get_type(), |
| 2206 | array( |
| 2207 | 'label' => __( 'Typography', 'premium-addons-for-elementor' ), |
| 2208 | 'name' => 'currency_typo', |
| 2209 | 'global' => array( |
| 2210 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2211 | ), |
| 2212 | 'selector' => '{{WRAPPER}} .premium-pricing-price-currency', |
| 2213 | 'condition' => array( |
| 2214 | 'price_effects!' => 'effect-1', |
| 2215 | ), |
| 2216 | ) |
| 2217 | ); |
| 2218 | |
| 2219 | $this->add_responsive_control( |
| 2220 | 'premium_pricing_currency_align', |
| 2221 | array( |
| 2222 | 'label' => __( 'Vertical Align', 'premium-addons-for-elementor' ), |
| 2223 | 'type' => Controls_Manager::CHOOSE, |
| 2224 | 'options' => array( |
| 2225 | 'top' => array( |
| 2226 | 'title' => __( 'Top', 'premium-addons-for-elementor' ), |
| 2227 | 'icon' => 'eicon-arrow-up', |
| 2228 | ), |
| 2229 | 'unset' => array( |
| 2230 | 'title' => __( 'Unset', 'premium-addons-for-elementor' ), |
| 2231 | 'icon' => 'eicon-text-align-justify', |
| 2232 | ), |
| 2233 | 'bottom' => array( |
| 2234 | 'title' => __( 'Bottom', 'premium-addons-for-elementor' ), |
| 2235 | 'icon' => 'eicon-arrow-down', |
| 2236 | ), |
| 2237 | ), |
| 2238 | 'default' => 'unset', |
| 2239 | 'toggle' => false, |
| 2240 | 'selectors_dictionary' => array( |
| 2241 | 'top' => 'flex-start', |
| 2242 | 'unset' => 'unset', |
| 2243 | 'bottom' => 'flex-end', |
| 2244 | ), |
| 2245 | 'selectors' => array( |
| 2246 | '{{WRAPPER}} .premium-pricing-price-currency' => 'align-self: {{VALUE}};', |
| 2247 | ), |
| 2248 | 'label_block' => false, |
| 2249 | 'condition' => array( |
| 2250 | 'price_effects!' => 'effect-1', |
| 2251 | ), |
| 2252 | ) |
| 2253 | ); |
| 2254 | |
| 2255 | $this->add_responsive_control( |
| 2256 | 'premium_pricing_currency_margin', |
| 2257 | array( |
| 2258 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2259 | 'type' => Controls_Manager::DIMENSIONS, |
| 2260 | 'size_units' => array( 'px', 'em', '%' ), |
| 2261 | 'selectors' => array( |
| 2262 | '{{WRAPPER}} .premium-pricing-price-currency' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2263 | 'separator' => 'after', |
| 2264 | ), |
| 2265 | 'condition' => array( |
| 2266 | 'price_effects!' => 'effect-1', |
| 2267 | ), |
| 2268 | ) |
| 2269 | ); |
| 2270 | |
| 2271 | $this->add_control( |
| 2272 | 'premium_pricing_price_heading', |
| 2273 | array( |
| 2274 | 'label' => __( 'Price', 'premium-addons-for-elementor' ), |
| 2275 | 'type' => Controls_Manager::HEADING, |
| 2276 | 'separator' => 'before', |
| 2277 | ) |
| 2278 | ); |
| 2279 | |
| 2280 | $this->add_control( |
| 2281 | 'premium_pricing_price_color', |
| 2282 | array( |
| 2283 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2284 | 'type' => Controls_Manager::COLOR, |
| 2285 | 'global' => array( |
| 2286 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2287 | ), |
| 2288 | 'selectors' => array( |
| 2289 | '{{WRAPPER}} .premium-pricing-price-value' => 'color: {{VALUE}};', |
| 2290 | ), |
| 2291 | ) |
| 2292 | ); |
| 2293 | |
| 2294 | $this->add_group_control( |
| 2295 | Group_Control_Typography::get_type(), |
| 2296 | array( |
| 2297 | 'label' => __( 'Typography', 'premium-addons-for-elementor' ), |
| 2298 | 'name' => 'price_typo', |
| 2299 | 'global' => array( |
| 2300 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2301 | ), |
| 2302 | 'selector' => '{{WRAPPER}} .premium-pricing-price-value , |
| 2303 | {{WRAPPER}}.pa-bt-effect__effect-1 .premium-pricing-price-value , |
| 2304 | {{WRAPPER}}.pa-bt-effect__effect-1 .premium-pricing-price-currency , |
| 2305 | {{WRAPPER}}.pa-bt-effect__effect-1 .premium-pricing-slashed-price-value ', |
| 2306 | ) |
| 2307 | ); |
| 2308 | |
| 2309 | $this->add_control( |
| 2310 | 'pa_price_background_color', |
| 2311 | array( |
| 2312 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2313 | 'type' => Controls_Manager::COLOR, |
| 2314 | 'global' => array( |
| 2315 | 'default' => Global_Colors::COLOR_TEXT, |
| 2316 | ), |
| 2317 | 'selectors' => array( |
| 2318 | '{{WRAPPER}} .premium-pricing-reveal-wrapper .premium-pricing-actual-wrapper' => 'background-color: {{VALUE}};', |
| 2319 | ), |
| 2320 | 'condition' => array( |
| 2321 | 'price_effects' => 'effect-1', |
| 2322 | ), |
| 2323 | ) |
| 2324 | ); |
| 2325 | |
| 2326 | $this->add_control( |
| 2327 | 'pa_price_border_radius', |
| 2328 | array( |
| 2329 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2330 | 'type' => Controls_Manager::DIMENSIONS, |
| 2331 | 'size_units' => array( 'px', 'em', '%', 'custom' ), |
| 2332 | 'selectors' => array( |
| 2333 | '{{WRAPPER}} .premium-pricing-reveal-wrapper.premium-pricing-actual-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2334 | ), |
| 2335 | 'condition' => array( |
| 2336 | 'price_effects' => 'effect-1', |
| 2337 | ), |
| 2338 | ) |
| 2339 | ); |
| 2340 | |
| 2341 | $this->add_responsive_control( |
| 2342 | 'premium_pricing_price_margin', |
| 2343 | array( |
| 2344 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2345 | 'type' => Controls_Manager::DIMENSIONS, |
| 2346 | 'size_units' => array( 'px', 'em', '%' ), |
| 2347 | 'selectors' => array( |
| 2348 | '{{WRAPPER}} .premium-pricing-price-value ' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2349 | ), |
| 2350 | 'condition' => array( |
| 2351 | 'price_effects!' => 'effect-1', |
| 2352 | ), |
| 2353 | ) |
| 2354 | ); |
| 2355 | |
| 2356 | $this->add_responsive_control( |
| 2357 | 'pa_pricing_price_reveal_padding', |
| 2358 | array( |
| 2359 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2360 | 'type' => Controls_Manager::DIMENSIONS, |
| 2361 | 'size_units' => array( 'px', 'em', '%' ), |
| 2362 | 'selectors' => array( |
| 2363 | '{{WRAPPER}} .premium-pricing-reveal-wrapper .premium-pricing-actual-wrapper, {{WRAPPER}} .premium-pricing-slashed-price-value ' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2364 | ), |
| 2365 | 'condition' => array( |
| 2366 | 'price_effects' => 'effect-1', |
| 2367 | ), |
| 2368 | ) |
| 2369 | ); |
| 2370 | |
| 2371 | $this->add_control( |
| 2372 | 'premium_pricing_sep_heading', |
| 2373 | array( |
| 2374 | 'label' => __( 'Divider', 'premium-addons-for-elementor' ), |
| 2375 | 'type' => Controls_Manager::HEADING, |
| 2376 | 'separator' => 'before', |
| 2377 | ) |
| 2378 | ); |
| 2379 | |
| 2380 | $this->add_control( |
| 2381 | 'premium_pricing_sep_color', |
| 2382 | array( |
| 2383 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2384 | 'type' => Controls_Manager::COLOR, |
| 2385 | 'global' => array( |
| 2386 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2387 | ), |
| 2388 | 'selectors' => array( |
| 2389 | '{{WRAPPER}} .premium-pricing-price-separator' => 'color: {{VALUE}};', |
| 2390 | ), |
| 2391 | ) |
| 2392 | ); |
| 2393 | |
| 2394 | $this->add_group_control( |
| 2395 | Group_Control_Typography::get_type(), |
| 2396 | array( |
| 2397 | 'label' => __( 'Typography', 'premium-addons-for-elementor' ), |
| 2398 | 'name' => 'separator_typo', |
| 2399 | 'global' => array( |
| 2400 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2401 | ), |
| 2402 | 'selector' => '{{WRAPPER}} .premium-pricing-price-separator', |
| 2403 | ) |
| 2404 | ); |
| 2405 | |
| 2406 | $this->add_responsive_control( |
| 2407 | 'premium_pricing_sep_margin', |
| 2408 | array( |
| 2409 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2410 | 'type' => Controls_Manager::DIMENSIONS, |
| 2411 | 'size_units' => array( 'px', 'em', '%' ), |
| 2412 | 'default' => array( |
| 2413 | 'top' => 0, |
| 2414 | 'right' => 0, |
| 2415 | 'bottom' => 20, |
| 2416 | 'left' => 0, |
| 2417 | 'unit' => 'px', |
| 2418 | ), |
| 2419 | 'selectors' => array( |
| 2420 | '{{WRAPPER}} .premium-pricing-price-separator' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2421 | ), |
| 2422 | ) |
| 2423 | ); |
| 2424 | |
| 2425 | $this->add_control( |
| 2426 | 'premium_pricing_dur_heading', |
| 2427 | array( |
| 2428 | 'label' => __( 'Duration', 'premium-addons-for-elementor' ), |
| 2429 | 'type' => Controls_Manager::HEADING, |
| 2430 | 'separator' => 'before', |
| 2431 | ) |
| 2432 | ); |
| 2433 | |
| 2434 | $this->add_control( |
| 2435 | 'premium_pricing_dur_color', |
| 2436 | array( |
| 2437 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2438 | 'type' => Controls_Manager::COLOR, |
| 2439 | 'global' => array( |
| 2440 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2441 | ), |
| 2442 | 'selectors' => array( |
| 2443 | '{{WRAPPER}} .premium-pricing-price-duration' => 'color: {{VALUE}};', |
| 2444 | ), |
| 2445 | ) |
| 2446 | ); |
| 2447 | |
| 2448 | $this->add_group_control( |
| 2449 | Group_Control_Typography::get_type(), |
| 2450 | array( |
| 2451 | 'label' => __( 'Typography', 'premium-addons-for-elementor' ), |
| 2452 | 'name' => 'duration_typo', |
| 2453 | 'global' => array( |
| 2454 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2455 | ), |
| 2456 | 'selector' => '{{WRAPPER}} .premium-pricing-price-duration', |
| 2457 | ) |
| 2458 | ); |
| 2459 | |
| 2460 | $this->add_responsive_control( |
| 2461 | 'premium_pricing_dur_margin', |
| 2462 | array( |
| 2463 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2464 | 'type' => Controls_Manager::DIMENSIONS, |
| 2465 | 'size_units' => array( 'px', 'em', '%' ), |
| 2466 | 'selectors' => array( |
| 2467 | '{{WRAPPER}} .premium-pricing-price-duration' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2468 | 'separator' => 'after', |
| 2469 | ), |
| 2470 | ) |
| 2471 | ); |
| 2472 | |
| 2473 | $this->add_control( |
| 2474 | 'premium_pricing_price_container_heading', |
| 2475 | array( |
| 2476 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 2477 | 'type' => Controls_Manager::HEADING, |
| 2478 | 'separator' => 'before', |
| 2479 | ) |
| 2480 | ); |
| 2481 | |
| 2482 | /*Price Background*/ |
| 2483 | $this->add_group_control( |
| 2484 | Premium_Background::get_type(), |
| 2485 | array( |
| 2486 | 'name' => 'premium_pricing_table_price_background', |
| 2487 | 'types' => array( 'classic', 'gradient' ), |
| 2488 | 'selector' => '{{WRAPPER}} .premium-pricing-price-container', |
| 2489 | ) |
| 2490 | ); |
| 2491 | |
| 2492 | $this->add_control( |
| 2493 | 'price_lq_effect', |
| 2494 | array( |
| 2495 | 'label' => __( 'Liquid Glass Effect', 'premium-addons-for-elementor' ), |
| 2496 | 'type' => Controls_Manager::SELECT, |
| 2497 | 'description' => sprintf( |
| 2498 | /* translators: 1: `<a>` opening tag, 2: `</a>` closing tag. */ |
| 2499 | esc_html__( 'Important: Make sure this element has a semi-transparent background color to see the effect. See all presets from %1$shere%2$s.', 'premium-addons-for-elementor' ), |
| 2500 | '<a href="https://premiumaddons.com/liquid-glass/" target="_blank">', |
| 2501 | '</a>' |
| 2502 | ), |
| 2503 | 'options' => array( |
| 2504 | 'none' => __( 'None', 'premium-addons-for-elementor' ), |
| 2505 | 'glass1' => __( 'Preset 01', 'premium-addons-for-elementor' ), |
| 2506 | 'glass2' => __( 'Preset 02', 'premium-addons-for-elementor' ), |
| 2507 | 'glass3' => apply_filters( 'pa_pro_label', __( 'Preset 03 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2508 | 'glass4' => apply_filters( 'pa_pro_label', __( 'Preset 04 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2509 | 'glass5' => apply_filters( 'pa_pro_label', __( 'Preset 05 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2510 | 'glass6' => apply_filters( 'pa_pro_label', __( 'Preset 06 (Pro)', 'premium-addons-for-elementor' ) ), |
| 2511 | ), |
| 2512 | 'default' => 'none', |
| 2513 | 'label_block' => true, |
| 2514 | ) |
| 2515 | ); |
| 2516 | |
| 2517 | $this->add_group_control( |
| 2518 | Group_Control_Border::get_type(), |
| 2519 | array( |
| 2520 | 'name' => 'price_cont_border', |
| 2521 | 'selector' => '{{WRAPPER}} .premium-pricing-price-container', |
| 2522 | ) |
| 2523 | ); |
| 2524 | |
| 2525 | $this->add_responsive_control( |
| 2526 | 'premium_pricing_price_padding', |
| 2527 | array( |
| 2528 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2529 | 'type' => Controls_Manager::DIMENSIONS, |
| 2530 | 'size_units' => array( 'px', 'em', '%' ), |
| 2531 | 'selectors' => array( |
| 2532 | '{{WRAPPER}} .premium-pricing-price-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2533 | ), |
| 2534 | ) |
| 2535 | ); |
| 2536 | |
| 2537 | $this->add_responsive_control( |
| 2538 | 'premium_pricing_price_container_margin', |
| 2539 | array( |
| 2540 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2541 | 'type' => Controls_Manager::DIMENSIONS, |
| 2542 | 'size_units' => array( 'px', 'em', '%' ), |
| 2543 | 'selectors' => array( |
| 2544 | '{{WRAPPER}} .premium-pricing-price-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2545 | ), |
| 2546 | ) |
| 2547 | ); |
| 2548 | |
| 2549 | $this->end_controls_section(); |
| 2550 | } |
| 2551 | |
| 2552 | private function add_feature_list_style_controls() { |
| 2553 | $this->start_controls_section( |
| 2554 | 'premium_pricing_list_style_settings', |
| 2555 | array( |
| 2556 | 'label' => __( 'Features', 'premium-addons-for-elementor' ), |
| 2557 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2558 | 'condition' => array( |
| 2559 | 'premium_pricing_table_list_switcher' => 'yes', |
| 2560 | ), |
| 2561 | ) |
| 2562 | ); |
| 2563 | |
| 2564 | $this->add_control( |
| 2565 | 'premium_pricing_features_text_heading', |
| 2566 | array( |
| 2567 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 2568 | 'type' => Controls_Manager::HEADING, |
| 2569 | ) |
| 2570 | ); |
| 2571 | |
| 2572 | $this->add_control( |
| 2573 | 'premium_pricing_list_text_color', |
| 2574 | array( |
| 2575 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2576 | 'type' => Controls_Manager::COLOR, |
| 2577 | 'global' => array( |
| 2578 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2579 | ), |
| 2580 | 'selectors' => array( |
| 2581 | '{{WRAPPER}} .premium-pricing-list-span' => 'color: {{VALUE}};', |
| 2582 | ), |
| 2583 | ) |
| 2584 | ); |
| 2585 | |
| 2586 | $this->add_group_control( |
| 2587 | Group_Control_Typography::get_type(), |
| 2588 | array( |
| 2589 | 'name' => 'list_typo', |
| 2590 | 'global' => array( |
| 2591 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2592 | ), |
| 2593 | 'selector' => '{{WRAPPER}} .premium-pricing-list .premium-pricing-list-span', |
| 2594 | ) |
| 2595 | ); |
| 2596 | |
| 2597 | $this->add_control( |
| 2598 | 'premium_pricing_features_icon_heading', |
| 2599 | array( |
| 2600 | 'label' => __( 'Icon', 'premium-addons-for-elementor' ), |
| 2601 | 'type' => Controls_Manager::HEADING, |
| 2602 | 'separator' => 'before', |
| 2603 | ) |
| 2604 | ); |
| 2605 | |
| 2606 | $this->add_control( |
| 2607 | 'premium_pricing_list_icon_color', |
| 2608 | array( |
| 2609 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2610 | 'type' => Controls_Manager::COLOR, |
| 2611 | 'global' => array( |
| 2612 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 2613 | ), |
| 2614 | 'selectors' => array( |
| 2615 | '{{WRAPPER}} .premium-pricing-feature-icon' => 'color: {{VALUE}}', |
| 2616 | '{{WRAPPER}} .premium-pricing-list-item .premium-drawable-icon *, {{WRAPPER}} .premium-pricing-list-item svg:not([class*="premium-"])' => 'fill: {{VALUE}};', |
| 2617 | ), |
| 2618 | ) |
| 2619 | ); |
| 2620 | |
| 2621 | $this->add_responsive_control( |
| 2622 | 'premium_pricing_list_icon_size', |
| 2623 | array( |
| 2624 | 'label' => __( 'Size', 'premium-addons-for-elementor' ), |
| 2625 | 'type' => Controls_Manager::SLIDER, |
| 2626 | 'default' => array( |
| 2627 | 'unit' => 'px', |
| 2628 | 'size' => 30, |
| 2629 | ), |
| 2630 | 'selectors' => array( |
| 2631 | '{{WRAPPER}} .premium-pricing-list i' => 'font-size: {{SIZE}}px', |
| 2632 | '{{WRAPPER}} .premium-pricing-list svg, {{WRAPPER}} .premium-pricing-list img' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important', |
| 2633 | ), |
| 2634 | ) |
| 2635 | ); |
| 2636 | |
| 2637 | $features_spacing = is_rtl() ? 'left' : 'right'; |
| 2638 | |
| 2639 | $this->add_responsive_control( |
| 2640 | 'premium_pricing_list_icon_spacing', |
| 2641 | array( |
| 2642 | 'label' => __( 'Spacing', 'premium-addons-for-elementor' ), |
| 2643 | 'type' => Controls_Manager::SLIDER, |
| 2644 | 'default' => array( |
| 2645 | 'size' => 5, |
| 2646 | ), |
| 2647 | 'selectors' => array( |
| 2648 | '{{WRAPPER}} .premium-pricing-feature-icon, {{WRAPPER}} .premium-pricing-list-item > svg' => 'margin-' . $features_spacing . ': {{SIZE}}px', |
| 2649 | ), |
| 2650 | ) |
| 2651 | ); |
| 2652 | |
| 2653 | $this->add_responsive_control( |
| 2654 | 'premium_pricing_list_item_margin', |
| 2655 | array( |
| 2656 | 'label' => __( 'Vertical Spacing', 'premium-addons-for-elementor' ), |
| 2657 | 'type' => Controls_Manager::SLIDER, |
| 2658 | 'selectors' => array( |
| 2659 | '{{WRAPPER}} .premium-pricing-list .premium-pricing-list-item' => 'margin-bottom: {{SIZE}}px;', |
| 2660 | ), |
| 2661 | 'separator' => 'after', |
| 2662 | ) |
| 2663 | ); |
| 2664 | |
| 2665 | $this->add_control( |
| 2666 | 'premium_pricing_features_container_heading', |
| 2667 | array( |
| 2668 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 2669 | 'type' => Controls_Manager::HEADING, |
| 2670 | ) |
| 2671 | ); |
| 2672 | |
| 2673 | $this->add_group_control( |
| 2674 | Premium_Background::get_type(), |
| 2675 | array( |
| 2676 | 'name' => 'premium_pricing_list_background', |
| 2677 | 'types' => array( 'classic', 'gradient' ), |
| 2678 | 'selector' => '{{WRAPPER}} .premium-pricing-list', |
| 2679 | ) |
| 2680 | ); |
| 2681 | |
| 2682 | /*List Border*/ |
| 2683 | $this->add_group_control( |
| 2684 | Group_Control_Border::get_type(), |
| 2685 | array( |
| 2686 | 'name' => 'premium_pricing_list_border', |
| 2687 | 'selector' => '{{WRAPPER}} .premium-pricing-list', |
| 2688 | ) |
| 2689 | ); |
| 2690 | |
| 2691 | /*List Border Radius*/ |
| 2692 | $this->add_control( |
| 2693 | 'premium_pricing_list_border_radius', |
| 2694 | array( |
| 2695 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 2696 | 'type' => Controls_Manager::SLIDER, |
| 2697 | 'size_units' => array( 'px', 'em', '%' ), |
| 2698 | 'selectors' => array( |
| 2699 | '{{WRAPPER}} .premium-pricing-list' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 2700 | ), |
| 2701 | ) |
| 2702 | ); |
| 2703 | |
| 2704 | /*List Padding*/ |
| 2705 | $this->add_responsive_control( |
| 2706 | 'premium_pricing_list_padding', |
| 2707 | array( |
| 2708 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2709 | 'type' => Controls_Manager::DIMENSIONS, |
| 2710 | 'size_units' => array( 'px', 'em', '%' ), |
| 2711 | 'selectors' => array( |
| 2712 | '{{WRAPPER}} .premium-pricing-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2713 | ), |
| 2714 | ) |
| 2715 | ); |
| 2716 | |
| 2717 | /*List Margin*/ |
| 2718 | $this->add_responsive_control( |
| 2719 | 'premium_pricing_list_margin', |
| 2720 | array( |
| 2721 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2722 | 'type' => Controls_Manager::DIMENSIONS, |
| 2723 | 'size_units' => array( 'px', 'em', '%' ), |
| 2724 | 'default' => array( |
| 2725 | 'top' => 30, |
| 2726 | 'right' => 0, |
| 2727 | 'bottom' => 30, |
| 2728 | 'left' => 0, |
| 2729 | 'unit' => 'px', |
| 2730 | ), |
| 2731 | 'selectors' => array( |
| 2732 | '{{WRAPPER}} .premium-pricing-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2733 | ), |
| 2734 | ) |
| 2735 | ); |
| 2736 | |
| 2737 | $this->end_controls_section(); |
| 2738 | } |
| 2739 | |
| 2740 | private function add_tooltips_style_controls() { |
| 2741 | $this->start_controls_section( |
| 2742 | 'tooltips_style', |
| 2743 | array( |
| 2744 | 'label' => __( 'Tooltips', 'premium-addons-for-elementor' ), |
| 2745 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2746 | 'condition' => array( |
| 2747 | 'premium_pricing_table_list_switcher' => 'yes', |
| 2748 | ), |
| 2749 | ) |
| 2750 | ); |
| 2751 | |
| 2752 | $this->add_responsive_control( |
| 2753 | 'tooltips_align', |
| 2754 | array( |
| 2755 | 'label' => __( 'Alignment', 'premium-addons-for-elementor' ), |
| 2756 | 'type' => Controls_Manager::CHOOSE, |
| 2757 | 'options' => array( |
| 2758 | 'left' => array( |
| 2759 | 'title' => __( 'Left', 'premium-addons-for-elementor' ), |
| 2760 | 'icon' => 'eicon-text-align-left', |
| 2761 | ), |
| 2762 | 'center' => array( |
| 2763 | 'title' => __( 'Center', 'premium-addons-for-elementor' ), |
| 2764 | 'icon' => 'eicon-text-align-center', |
| 2765 | ), |
| 2766 | 'right' => array( |
| 2767 | 'title' => __( 'Right', 'premium-addons-for-elementor' ), |
| 2768 | 'icon' => 'eicon-text-align-right', |
| 2769 | ), |
| 2770 | ), |
| 2771 | 'selectors' => array( |
| 2772 | '{{WRAPPER}} .premium-pricing-list-tooltip' => 'text-align: {{VALUE}}', |
| 2773 | ), |
| 2774 | ) |
| 2775 | ); |
| 2776 | |
| 2777 | $this->add_responsive_control( |
| 2778 | 'tooltips_width', |
| 2779 | array( |
| 2780 | 'label' => __( 'Width', 'premium-addons-for-elementor' ), |
| 2781 | 'type' => Controls_Manager::SLIDER, |
| 2782 | 'range' => array( |
| 2783 | 'px' => array( |
| 2784 | 'min' => 1, |
| 2785 | 'max' => 400, |
| 2786 | ), |
| 2787 | ), |
| 2788 | 'selectors' => array( |
| 2789 | '{{WRAPPER}} .premium-pricing-list-tooltip' => 'min-width: {{SIZE}}px;', |
| 2790 | ), |
| 2791 | ) |
| 2792 | ); |
| 2793 | |
| 2794 | $this->add_control( |
| 2795 | 'tooltips_color', |
| 2796 | array( |
| 2797 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2798 | 'type' => Controls_Manager::COLOR, |
| 2799 | 'selectors' => array( |
| 2800 | '{{WRAPPER}} .premium-pricing-list-tooltip' => 'color: {{VALUE}};', |
| 2801 | ), |
| 2802 | ) |
| 2803 | ); |
| 2804 | |
| 2805 | $this->add_group_control( |
| 2806 | Group_Control_Typography::get_type(), |
| 2807 | array( |
| 2808 | 'name' => 'tooltips_typo', |
| 2809 | 'global' => array( |
| 2810 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2811 | ), |
| 2812 | 'selector' => '{{WRAPPER}} .premium-pricing-list-tooltip', |
| 2813 | ) |
| 2814 | ); |
| 2815 | |
| 2816 | $this->add_control( |
| 2817 | 'tooltips_background_color', |
| 2818 | array( |
| 2819 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 2820 | 'type' => Controls_Manager::COLOR, |
| 2821 | 'selectors' => array( |
| 2822 | '{{WRAPPER}} .premium-pricing-list-tooltip' => 'background-color: {{VALUE}};', |
| 2823 | ), |
| 2824 | ) |
| 2825 | ); |
| 2826 | |
| 2827 | $this->add_control( |
| 2828 | 'tooltips_border_color', |
| 2829 | array( |
| 2830 | 'label' => __( 'Border Color', 'premium-addons-for-elementor' ), |
| 2831 | 'type' => Controls_Manager::COLOR, |
| 2832 | 'selectors' => array( |
| 2833 | '{{WRAPPER}} .list-item-tooltip' => 'border-color: {{VALUE}};', |
| 2834 | ), |
| 2835 | ) |
| 2836 | ); |
| 2837 | |
| 2838 | $this->end_controls_section(); |
| 2839 | } |
| 2840 | |
| 2841 | private function add_description_style_controls() { |
| 2842 | $this->start_controls_section( |
| 2843 | 'premium_pricing_description_style_settings', |
| 2844 | array( |
| 2845 | 'label' => __( 'Description', 'premium-addons-for-elementor' ), |
| 2846 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2847 | 'condition' => array( |
| 2848 | 'premium_pricing_table_description_switcher' => 'yes', |
| 2849 | ), |
| 2850 | ) |
| 2851 | ); |
| 2852 | |
| 2853 | $this->add_control( |
| 2854 | 'premium_pricing_desc_text_heading', |
| 2855 | array( |
| 2856 | 'label' => __( 'Text', 'premium-addons-for-elementor' ), |
| 2857 | 'type' => Controls_Manager::HEADING, |
| 2858 | ) |
| 2859 | ); |
| 2860 | |
| 2861 | $this->add_control( |
| 2862 | 'premium_pricing_desc_color', |
| 2863 | array( |
| 2864 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 2865 | 'type' => Controls_Manager::COLOR, |
| 2866 | 'global' => array( |
| 2867 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2868 | ), |
| 2869 | 'selectors' => array( |
| 2870 | '{{WRAPPER}} .premium-pricing-description-container' => 'color: {{VALUE}};', |
| 2871 | ), |
| 2872 | ) |
| 2873 | ); |
| 2874 | |
| 2875 | $this->add_group_control( |
| 2876 | Group_Control_Typography::get_type(), |
| 2877 | array( |
| 2878 | 'name' => 'description_typo', |
| 2879 | 'global' => array( |
| 2880 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2881 | ), |
| 2882 | 'selector' => '{{WRAPPER}} .premium-pricing-description-container', |
| 2883 | ) |
| 2884 | ); |
| 2885 | |
| 2886 | $this->add_control( |
| 2887 | 'premium_pricing_desc_container_heading', |
| 2888 | array( |
| 2889 | 'label' => __( 'Container', 'premium-addons-for-elementor' ), |
| 2890 | 'type' => Controls_Manager::HEADING, |
| 2891 | ) |
| 2892 | ); |
| 2893 | |
| 2894 | $this->add_group_control( |
| 2895 | Premium_Background::get_type(), |
| 2896 | array( |
| 2897 | 'name' => 'premium_pricing_table_desc_background', |
| 2898 | 'types' => array( 'classic', 'gradient' ), |
| 2899 | 'selector' => '{{WRAPPER}} .premium-pricing-description-container', |
| 2900 | ) |
| 2901 | ); |
| 2902 | |
| 2903 | $this->add_responsive_control( |
| 2904 | 'premium_pricing_desc_margin', |
| 2905 | array( |
| 2906 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 2907 | 'type' => Controls_Manager::DIMENSIONS, |
| 2908 | 'size_units' => array( 'px', 'em', '%' ), |
| 2909 | 'default' => array( |
| 2910 | 'top' => 16, |
| 2911 | 'right' => 0, |
| 2912 | 'bottom' => 16, |
| 2913 | 'left' => 0, |
| 2914 | 'unit' => 'px', |
| 2915 | ), |
| 2916 | 'selectors' => array( |
| 2917 | '{{WRAPPER}} .premium-pricing-description-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2918 | ), |
| 2919 | ) |
| 2920 | ); |
| 2921 | |
| 2922 | $this->add_responsive_control( |
| 2923 | 'premium_pricing_desc_padding', |
| 2924 | array( |
| 2925 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 2926 | 'type' => Controls_Manager::DIMENSIONS, |
| 2927 | 'size_units' => array( 'px', 'em', '%' ), |
| 2928 | 'selectors' => array( |
| 2929 | '{{WRAPPER}} .premium-pricing-description-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 2930 | ), |
| 2931 | ) |
| 2932 | ); |
| 2933 | |
| 2934 | $this->end_controls_section(); |
| 2935 | } |
| 2936 | |
| 2937 | private function add_button_style_controls() { |
| 2938 | $this->start_controls_section( |
| 2939 | 'premium_pricing_button_style_settings', |
| 2940 | array( |
| 2941 | 'label' => __( 'Button', 'premium-addons-for-elementor' ), |
| 2942 | 'tab' => Controls_Manager::TAB_STYLE, |
| 2943 | 'condition' => array( |
| 2944 | 'premium_pricing_table_button_switcher' => 'yes', |
| 2945 | ), |
| 2946 | ) |
| 2947 | ); |
| 2948 | |
| 2949 | $this->add_group_control( |
| 2950 | Group_Control_Typography::get_type(), |
| 2951 | array( |
| 2952 | 'name' => 'button_typo', |
| 2953 | 'global' => array( |
| 2954 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 2955 | ), |
| 2956 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button', |
| 2957 | ) |
| 2958 | ); |
| 2959 | |
| 2960 | $this->start_controls_tabs( 'premium_pricing_table_button_style_tabs' ); |
| 2961 | |
| 2962 | $this->start_controls_tab( |
| 2963 | 'premium_pricing_table_button_style_normal', |
| 2964 | array( |
| 2965 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 2966 | ) |
| 2967 | ); |
| 2968 | |
| 2969 | $this->add_control( |
| 2970 | 'premium_pricing_button_color', |
| 2971 | array( |
| 2972 | 'label' => __( 'Text Color', 'premium-addons-for-elementor' ), |
| 2973 | 'type' => Controls_Manager::COLOR, |
| 2974 | 'global' => array( |
| 2975 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 2976 | ), |
| 2977 | 'selectors' => array( |
| 2978 | '{{WRAPPER}} .premium-pricing-price-button' => 'color: {{VALUE}};', |
| 2979 | ), |
| 2980 | ) |
| 2981 | ); |
| 2982 | |
| 2983 | $this->add_group_control( |
| 2984 | Premium_Background::get_type(), |
| 2985 | array( |
| 2986 | 'name' => 'premium_pricing_table_button_background', |
| 2987 | 'types' => array( 'classic', 'gradient' ), |
| 2988 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button, {{WRAPPER}} .premium-button-style2-shutinhor:before , {{WRAPPER}} .premium-button-style2-shutinver:before , {{WRAPPER}} .premium-button-style5-radialin:before , {{WRAPPER}} .premium-button-style5-rectin:before', |
| 2989 | ) |
| 2990 | ); |
| 2991 | |
| 2992 | $this->add_group_control( |
| 2993 | Group_Control_Border::get_type(), |
| 2994 | array( |
| 2995 | 'name' => 'premium_pricing_table_button_border', |
| 2996 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button', |
| 2997 | ) |
| 2998 | ); |
| 2999 | |
| 3000 | $this->add_control( |
| 3001 | 'premium_pricing_table_box_button_radius', |
| 3002 | array( |
| 3003 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3004 | 'type' => Controls_Manager::SLIDER, |
| 3005 | 'size_units' => array( 'px', 'em', '%' ), |
| 3006 | 'selectors' => array( |
| 3007 | '{{WRAPPER}} .premium-pricing-price-button' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3008 | ), |
| 3009 | ) |
| 3010 | ); |
| 3011 | |
| 3012 | $this->add_group_control( |
| 3013 | Group_Control_Box_Shadow::get_type(), |
| 3014 | array( |
| 3015 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 3016 | 'name' => 'premium_pricing_table_button_box_shadow', |
| 3017 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button', |
| 3018 | ) |
| 3019 | ); |
| 3020 | |
| 3021 | $this->add_responsive_control( |
| 3022 | 'premium_pricing_button_margin', |
| 3023 | array( |
| 3024 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 3025 | 'type' => Controls_Manager::DIMENSIONS, |
| 3026 | 'size_units' => array( 'px', 'em', '%' ), |
| 3027 | 'selectors' => array( |
| 3028 | '{{WRAPPER}} .premium-pricing-button-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3029 | ), |
| 3030 | ) |
| 3031 | ); |
| 3032 | |
| 3033 | $this->add_responsive_control( |
| 3034 | 'premium_pricing_button_padding', |
| 3035 | array( |
| 3036 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 3037 | 'type' => Controls_Manager::DIMENSIONS, |
| 3038 | 'size_units' => array( 'px', 'em', '%' ), |
| 3039 | 'default' => array( |
| 3040 | 'top' => 20, |
| 3041 | 'right' => 0, |
| 3042 | 'bottom' => 20, |
| 3043 | 'left' => 0, |
| 3044 | 'unit' => 'px', |
| 3045 | ), |
| 3046 | 'selectors' => array( |
| 3047 | '{{WRAPPER}} .premium-pricing-price-button, {{WRAPPER}} .premium-button-line6::after' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3048 | ), |
| 3049 | ) |
| 3050 | ); |
| 3051 | |
| 3052 | $this->end_controls_tab(); |
| 3053 | |
| 3054 | $this->start_controls_tab( |
| 3055 | 'premium_pricing_table_button_style_hover', |
| 3056 | array( |
| 3057 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 3058 | ) |
| 3059 | ); |
| 3060 | |
| 3061 | $this->add_control( |
| 3062 | 'premium_pricing_button_hover_color', |
| 3063 | array( |
| 3064 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 3065 | 'type' => Controls_Manager::COLOR, |
| 3066 | 'global' => array( |
| 3067 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3068 | ), |
| 3069 | 'selectors' => array( |
| 3070 | '{{WRAPPER}} .premium-pricing-price-button:hover, {{WRAPPER}} .premium-button-line6::after' => 'color: {{VALUE}};', |
| 3071 | ), |
| 3072 | ) |
| 3073 | ); |
| 3074 | |
| 3075 | $this->add_control( |
| 3076 | 'underline_color', |
| 3077 | array( |
| 3078 | 'label' => __( 'Line Color', 'premium-addons-for-elementor' ), |
| 3079 | 'type' => Controls_Manager::COLOR, |
| 3080 | 'global' => array( |
| 3081 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3082 | ), |
| 3083 | 'selectors' => array( |
| 3084 | '{{WRAPPER}} .premium-btn-svg' => 'stroke: {{VALUE}};', |
| 3085 | '{{WRAPPER}} .premium-button-line2::before, {{WRAPPER}} .premium-button-line4::before, {{WRAPPER}} .premium-button-line5::before, {{WRAPPER}} .premium-button-line5::after, {{WRAPPER}} .premium-button-line6::before, {{WRAPPER}} .premium-button-line7::before' => 'background-color: {{VALUE}};', |
| 3086 | ), |
| 3087 | 'condition' => array( |
| 3088 | 'premium_button_hover_effect' => 'style8', |
| 3089 | ), |
| 3090 | ) |
| 3091 | ); |
| 3092 | |
| 3093 | $this->add_control( |
| 3094 | 'first_layer_hover', |
| 3095 | array( |
| 3096 | 'label' => __( 'Layer #1 Color', 'premium-addons-for-elementor' ), |
| 3097 | 'type' => Controls_Manager::COLOR, |
| 3098 | 'global' => array( |
| 3099 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3100 | ), |
| 3101 | 'selectors' => array( |
| 3102 | '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:before' => 'background-color: {{VALUE}}', |
| 3103 | ), |
| 3104 | 'condition' => array( |
| 3105 | 'premium_button_hover_effect' => 'style7', |
| 3106 | |
| 3107 | ), |
| 3108 | ) |
| 3109 | ); |
| 3110 | |
| 3111 | $this->add_control( |
| 3112 | 'second_layer_hover', |
| 3113 | array( |
| 3114 | 'label' => __( 'Layer #2 Color', 'premium-addons-for-elementor' ), |
| 3115 | 'type' => Controls_Manager::COLOR, |
| 3116 | 'global' => array( |
| 3117 | 'default' => Global_Colors::COLOR_TEXT, |
| 3118 | ), |
| 3119 | 'selectors' => array( |
| 3120 | '{{WRAPPER}} .premium-button-style7 .premium-button-text-icon-wrapper:after' => 'background-color: {{VALUE}}', |
| 3121 | ), |
| 3122 | 'condition' => array( |
| 3123 | 'premium_button_hover_effect' => 'style7', |
| 3124 | ), |
| 3125 | ) |
| 3126 | ); |
| 3127 | |
| 3128 | $this->add_group_control( |
| 3129 | Premium_Background::get_type(), |
| 3130 | array( |
| 3131 | 'name' => 'premium_pricing_table_button_background_hover', |
| 3132 | 'types' => array( 'classic', 'gradient' ), |
| 3133 | 'selector' => '{{WRAPPER}} .premium-button-none:hover, {{WRAPPER}} .premium-button-style8:hover, {{WRAPPER}} .premium-button-style1:before, {{WRAPPER}} .premium-button-style2-shutouthor:before, {{WRAPPER}} .premium-button-style2-shutoutver:before, {{WRAPPER}} .premium-button-style2-shutinhor, {{WRAPPER}} .premium-button-style2-shutinver, {{WRAPPER}} .premium-button-style2-dshutinhor:before, {{WRAPPER}} .premium-button-style2-dshutinver:before, {{WRAPPER}} .premium-button-style2-scshutouthor:before, {{WRAPPER}} .premium-button-style2-scshutoutver:before, {{WRAPPER}} .premium-button-style5-radialin, {{WRAPPER}} .premium-button-style5-radialout:before, {{WRAPPER}} .premium-button-style5-rectin, {{WRAPPER}} .premium-button-style5-rectout:before, {{WRAPPER}} .premium-button-style6-bg, {{WRAPPER}} .premium-button-style6:before', |
| 3134 | 'condition' => array( |
| 3135 | 'premium_button_hover_effect!' => 'style7', |
| 3136 | ), |
| 3137 | ), |
| 3138 | ); |
| 3139 | |
| 3140 | $this->add_group_control( |
| 3141 | Group_Control_Border::get_type(), |
| 3142 | array( |
| 3143 | 'name' => 'premium_pricing_table_button_border_hover', |
| 3144 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button:hover', |
| 3145 | ) |
| 3146 | ); |
| 3147 | |
| 3148 | $this->add_control( |
| 3149 | 'premium_pricing_table_button_border_radius_hover', |
| 3150 | array( |
| 3151 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3152 | 'type' => Controls_Manager::SLIDER, |
| 3153 | 'size_units' => array( 'px', 'em', '%' ), |
| 3154 | 'selectors' => array( |
| 3155 | '{{WRAPPER}} .premium-pricing-price-button:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3156 | ), |
| 3157 | ) |
| 3158 | ); |
| 3159 | |
| 3160 | $this->add_group_control( |
| 3161 | Group_Control_Box_Shadow::get_type(), |
| 3162 | array( |
| 3163 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 3164 | 'name' => 'premium_pricing_table_button_shadow_hover', |
| 3165 | 'selector' => '{{WRAPPER}} .premium-pricing-price-button:hover', |
| 3166 | ) |
| 3167 | ); |
| 3168 | |
| 3169 | $this->add_responsive_control( |
| 3170 | 'premium_pricing_button_margin_hover', |
| 3171 | array( |
| 3172 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 3173 | 'type' => Controls_Manager::DIMENSIONS, |
| 3174 | 'size_units' => array( 'px', 'em', '%' ), |
| 3175 | 'selectors' => array( |
| 3176 | '{{WRAPPER}} .premium-pricing-button-container:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3177 | ), |
| 3178 | ) |
| 3179 | ); |
| 3180 | |
| 3181 | $this->add_responsive_control( |
| 3182 | 'premium_pricing_button_padding_hover', |
| 3183 | array( |
| 3184 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 3185 | 'type' => Controls_Manager::DIMENSIONS, |
| 3186 | 'default' => array( |
| 3187 | 'top' => 20, |
| 3188 | 'right' => 0, |
| 3189 | 'bottom' => 20, |
| 3190 | 'left' => 0, |
| 3191 | 'unit' => 'px', |
| 3192 | ), |
| 3193 | 'size_units' => array( 'px', 'em', '%' ), |
| 3194 | 'selectors' => array( |
| 3195 | '{{WRAPPER}} .premium-pricing-price-button:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3196 | ), |
| 3197 | ) |
| 3198 | ); |
| 3199 | |
| 3200 | $this->end_controls_tab(); |
| 3201 | |
| 3202 | $this->end_controls_tabs(); |
| 3203 | |
| 3204 | $this->end_controls_section(); |
| 3205 | } |
| 3206 | |
| 3207 | private function add_ribbon_style_controls() { |
| 3208 | $this->start_controls_section( |
| 3209 | 'premium_pricing_table_badge_style', |
| 3210 | array( |
| 3211 | 'label' => __( 'Ribbon', 'premium-addons-for-elementor' ), |
| 3212 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3213 | 'condition' => array( |
| 3214 | 'premium_pricing_table_badge_switcher' => 'yes', |
| 3215 | ), |
| 3216 | ) |
| 3217 | ); |
| 3218 | |
| 3219 | $this->add_control( |
| 3220 | 'premium_pricing_badge_text_color', |
| 3221 | array( |
| 3222 | 'label' => __( 'Color', 'premium-addons-for-elementor' ), |
| 3223 | 'type' => Controls_Manager::COLOR, |
| 3224 | 'global' => array( |
| 3225 | 'default' => Global_Colors::COLOR_SECONDARY, |
| 3226 | ), |
| 3227 | 'selectors' => array( |
| 3228 | '{{WRAPPER}} .premium-pricing-badge-container .corner span' => 'color: {{VALUE}};', |
| 3229 | ), |
| 3230 | ) |
| 3231 | ); |
| 3232 | |
| 3233 | $this->add_group_control( |
| 3234 | Group_Control_Typography::get_type(), |
| 3235 | array( |
| 3236 | 'name' => 'badge_text_typo', |
| 3237 | 'global' => array( |
| 3238 | 'default' => Global_Typography::TYPOGRAPHY_PRIMARY, |
| 3239 | ), |
| 3240 | 'selector' => '{{WRAPPER}} .premium-pricing-badge-container .corner span', |
| 3241 | ) |
| 3242 | ); |
| 3243 | |
| 3244 | $this->add_control( |
| 3245 | 'premium_pricing_badge_left_color', |
| 3246 | array( |
| 3247 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 3248 | 'type' => Controls_Manager::COLOR, |
| 3249 | 'global' => array( |
| 3250 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 3251 | ), |
| 3252 | 'selectors' => array( |
| 3253 | '{{WRAPPER}} .premium-badge-triangle.premium-badge-left .corner' => 'border-top-color: {{VALUE}}', |
| 3254 | '{{WRAPPER}} .premium-badge-triangle.premium-badge-right .corner' => 'border-right-color: {{VALUE}}', |
| 3255 | ), |
| 3256 | 'condition' => array( |
| 3257 | 'ribbon_type' => 'triangle', |
| 3258 | ), |
| 3259 | ) |
| 3260 | ); |
| 3261 | |
| 3262 | $this->add_control( |
| 3263 | 'ribbon_background', |
| 3264 | array( |
| 3265 | 'label' => __( 'Background Color', 'premium-addons-for-elementor' ), |
| 3266 | 'type' => Controls_Manager::COLOR, |
| 3267 | 'global' => array( |
| 3268 | 'default' => Global_Colors::COLOR_PRIMARY, |
| 3269 | ), |
| 3270 | 'selectors' => array( |
| 3271 | '{{WRAPPER}} .premium-badge-circle, {{WRAPPER}} .premium-badge-stripe .corner, {{WRAPPER}} .premium-badge-flag .corner' => 'background-color: {{VALUE}}', |
| 3272 | '{{WRAPPER}} .premium-badge-flag.premium-badge-right .corner::before' => 'border-left: 8px solid {{VALUE}}', |
| 3273 | '{{WRAPPER}} .premium-badge-flag.premium-badge-left .corner::after' => 'border-right: 8px solid {{VALUE}}', |
| 3274 | ), |
| 3275 | 'condition' => array( |
| 3276 | 'ribbon_type!' => 'triangle', |
| 3277 | ), |
| 3278 | ) |
| 3279 | ); |
| 3280 | |
| 3281 | $this->add_group_control( |
| 3282 | Group_Control_Box_Shadow::get_type(), |
| 3283 | array( |
| 3284 | 'name' => 'ribbon_shadow', |
| 3285 | 'selector' => '{{WRAPPER}} .premium-badge-circle, {{WRAPPER}} .premium-badge-stripe .corner, {{WRAPPER}} .premium-badge-flag .corner', |
| 3286 | 'condition' => array( |
| 3287 | 'ribbon_type!' => 'triangle', |
| 3288 | ), |
| 3289 | ) |
| 3290 | ); |
| 3291 | |
| 3292 | $this->end_controls_section(); |
| 3293 | } |
| 3294 | |
| 3295 | private function add_box_style_controls() { |
| 3296 | $this->start_controls_section( |
| 3297 | 'premium_pricing_box_style_settings', |
| 3298 | array( |
| 3299 | 'label' => __( 'Box Settings', 'premium-addons-for-elementor' ), |
| 3300 | 'tab' => Controls_Manager::TAB_STYLE, |
| 3301 | ) |
| 3302 | ); |
| 3303 | |
| 3304 | $this->start_controls_tabs( 'premium_pricing_table_box_style_tabs' ); |
| 3305 | |
| 3306 | $this->start_controls_tab( |
| 3307 | 'premium_pricing_table_box_style_normal', |
| 3308 | array( |
| 3309 | 'label' => __( 'Normal', 'premium-addons-for-elementor' ), |
| 3310 | ) |
| 3311 | ); |
| 3312 | |
| 3313 | $this->add_group_control( |
| 3314 | Premium_Background::get_type(), |
| 3315 | array( |
| 3316 | 'name' => 'premium_pricing_table_box_background', |
| 3317 | 'types' => array( 'classic', 'gradient' ), |
| 3318 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container', |
| 3319 | ) |
| 3320 | ); |
| 3321 | |
| 3322 | $this->add_group_control( |
| 3323 | Group_Control_Border::get_type(), |
| 3324 | array( |
| 3325 | 'name' => 'premium_pricing_table_box_border', |
| 3326 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container', |
| 3327 | ) |
| 3328 | ); |
| 3329 | |
| 3330 | $this->add_control( |
| 3331 | 'premium_pricing_table_box_border_radius', |
| 3332 | array( |
| 3333 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3334 | 'type' => Controls_Manager::SLIDER, |
| 3335 | 'size_units' => array( 'px', '%', 'em' ), |
| 3336 | 'selectors' => array( |
| 3337 | '{{WRAPPER}} .premium-pricing-table-container' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3338 | ), |
| 3339 | 'condition' => array( |
| 3340 | 'table_adv_radius!' => 'yes', |
| 3341 | ), |
| 3342 | ) |
| 3343 | ); |
| 3344 | |
| 3345 | $this->add_control( |
| 3346 | 'table_adv_radius', |
| 3347 | array( |
| 3348 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 3349 | 'type' => Controls_Manager::SWITCHER, |
| 3350 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 3351 | ) |
| 3352 | ); |
| 3353 | |
| 3354 | $this->add_control( |
| 3355 | 'table_adv_radius_value', |
| 3356 | array( |
| 3357 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3358 | 'type' => Controls_Manager::TEXT, |
| 3359 | 'dynamic' => array( 'active' => true ), |
| 3360 | 'selectors' => array( |
| 3361 | '{{WRAPPER}} .premium-pricing-table-container' => 'border-radius: {{VALUE}};', |
| 3362 | ), |
| 3363 | 'condition' => array( |
| 3364 | 'table_adv_radius' => 'yes', |
| 3365 | ), |
| 3366 | 'ai' => array( |
| 3367 | 'active' => false, |
| 3368 | ), |
| 3369 | ) |
| 3370 | ); |
| 3371 | |
| 3372 | $this->add_group_control( |
| 3373 | Group_Control_Box_Shadow::get_type(), |
| 3374 | array( |
| 3375 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 3376 | 'name' => 'premium_pricing_table_box_shadow', |
| 3377 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container', |
| 3378 | ) |
| 3379 | ); |
| 3380 | |
| 3381 | $this->add_responsive_control( |
| 3382 | 'premium_pricing_box_margin', |
| 3383 | array( |
| 3384 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 3385 | 'type' => Controls_Manager::DIMENSIONS, |
| 3386 | 'size_units' => array( 'px', 'em', '%' ), |
| 3387 | 'selectors' => array( |
| 3388 | '{{WRAPPER}} .premium-pricing-table-container' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3389 | ), |
| 3390 | ) |
| 3391 | ); |
| 3392 | |
| 3393 | $this->add_responsive_control( |
| 3394 | 'premium_pricing_box_padding', |
| 3395 | array( |
| 3396 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 3397 | 'type' => Controls_Manager::DIMENSIONS, |
| 3398 | 'size_units' => array( 'px', 'em', '%' ), |
| 3399 | 'default' => array( |
| 3400 | 'top' => 40, |
| 3401 | 'right' => 0, |
| 3402 | 'bottom' => 0, |
| 3403 | 'left' => 0, |
| 3404 | 'unit' => 'px', |
| 3405 | ), |
| 3406 | 'selectors' => array( |
| 3407 | '{{WRAPPER}} .premium-pricing-table-container' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3408 | ), |
| 3409 | ) |
| 3410 | ); |
| 3411 | |
| 3412 | $this->end_controls_tab(); |
| 3413 | |
| 3414 | $this->start_controls_tab( |
| 3415 | 'premium_pricing_table_box_style_hover', |
| 3416 | array( |
| 3417 | 'label' => __( 'Hover', 'premium-addons-for-elementor' ), |
| 3418 | ) |
| 3419 | ); |
| 3420 | |
| 3421 | $this->add_group_control( |
| 3422 | Premium_Background::get_type(), |
| 3423 | array( |
| 3424 | 'name' => 'premium_pricing_table_box_background_hover', |
| 3425 | 'types' => array( 'classic', 'gradient' ), |
| 3426 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container:hover', |
| 3427 | ) |
| 3428 | ); |
| 3429 | |
| 3430 | $this->add_group_control( |
| 3431 | Group_Control_Border::get_type(), |
| 3432 | array( |
| 3433 | 'name' => 'premium_pricing_table_box_border_hover', |
| 3434 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container:hover', |
| 3435 | ) |
| 3436 | ); |
| 3437 | |
| 3438 | $this->add_control( |
| 3439 | 'premium_pricing_table_box_border_radius_hover', |
| 3440 | array( |
| 3441 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3442 | 'type' => Controls_Manager::SLIDER, |
| 3443 | 'size_units' => array( 'px', 'em', '%' ), |
| 3444 | 'selectors' => array( |
| 3445 | '{{WRAPPER}} .premium-pricing-table-container:hover' => 'border-radius: {{SIZE}}{{UNIT}};', |
| 3446 | ), |
| 3447 | 'condition' => array( |
| 3448 | 'table_hover_adv_radius' => 'yes', |
| 3449 | ), |
| 3450 | ) |
| 3451 | ); |
| 3452 | |
| 3453 | $this->add_control( |
| 3454 | 'table_hover_adv_radius', |
| 3455 | array( |
| 3456 | 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ), |
| 3457 | 'type' => Controls_Manager::SWITCHER, |
| 3458 | 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>' . __( '. See ', 'premium-addons-for-elementor' ) . '<a href="https://www.youtube.com/watch?v=S0BJazLHV-M" target="_blank">tutorial</a>', |
| 3459 | ) |
| 3460 | ); |
| 3461 | |
| 3462 | $this->add_control( |
| 3463 | 'table_hover_adv_radius_value', |
| 3464 | array( |
| 3465 | 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ), |
| 3466 | 'type' => Controls_Manager::TEXT, |
| 3467 | 'dynamic' => array( 'active' => true ), |
| 3468 | 'selectors' => array( |
| 3469 | '{{WRAPPER}} .premium-pricing-table-container:hover' => 'border-radius: {{VALUE}};', |
| 3470 | ), |
| 3471 | 'condition' => array( |
| 3472 | 'table_hover_adv_radius' => 'yes', |
| 3473 | ), |
| 3474 | 'ai' => array( |
| 3475 | 'active' => false, |
| 3476 | ), |
| 3477 | ) |
| 3478 | ); |
| 3479 | |
| 3480 | $this->add_group_control( |
| 3481 | Group_Control_Box_Shadow::get_type(), |
| 3482 | array( |
| 3483 | 'label' => __( 'Shadow', 'premium-addons-for-elementor' ), |
| 3484 | 'name' => 'premium_pricing_table_box_shadow_hover', |
| 3485 | 'selector' => '{{WRAPPER}} .premium-pricing-table-container:hover', |
| 3486 | ) |
| 3487 | ); |
| 3488 | |
| 3489 | $this->add_responsive_control( |
| 3490 | 'premium_pricing_box_margin_hover', |
| 3491 | array( |
| 3492 | 'label' => __( 'Margin', 'premium-addons-for-elementor' ), |
| 3493 | 'type' => Controls_Manager::DIMENSIONS, |
| 3494 | 'size_units' => array( 'px', 'em', '%' ), |
| 3495 | 'selectors' => array( |
| 3496 | '{{WRAPPER}} .premium-pricing-table-container:hover' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3497 | ), |
| 3498 | ) |
| 3499 | ); |
| 3500 | |
| 3501 | $this->add_responsive_control( |
| 3502 | 'premium_pricing_box_padding_hover', |
| 3503 | array( |
| 3504 | 'label' => __( 'Padding', 'premium-addons-for-elementor' ), |
| 3505 | 'type' => Controls_Manager::DIMENSIONS, |
| 3506 | 'size_units' => array( 'px', 'em', '%' ), |
| 3507 | 'default' => array( |
| 3508 | 'top' => 40, |
| 3509 | 'right' => 0, |
| 3510 | 'bottom' => 0, |
| 3511 | 'left' => 0, |
| 3512 | 'unit' => 'px', |
| 3513 | ), |
| 3514 | 'selectors' => array( |
| 3515 | '{{WRAPPER}} .premium-pricing-table-container:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 3516 | ), |
| 3517 | ) |
| 3518 | ); |
| 3519 | |
| 3520 | $this->end_controls_tab(); |
| 3521 | |
| 3522 | $this->end_controls_tabs(); |
| 3523 | |
| 3524 | $this->end_controls_section(); |
| 3525 | } |
| 3526 | |
| 3527 | /** |
| 3528 | * Render Pricing Table widget output on the frontend. |
| 3529 | * |
| 3530 | * Written in PHP and used to generate the final HTML. |
| 3531 | * |
| 3532 | * @since 1.0.0 |
| 3533 | * @access protected |
| 3534 | */ |
| 3535 | protected function render() { |
| 3536 | |
| 3537 | $settings = $this->get_settings_for_display(); |
| 3538 | |
| 3539 | $this->add_inline_editing_attributes( 'premium_pricing_table_title_text' ); |
| 3540 | $this->add_render_attribute( 'premium_pricing_table_title_text', 'class', 'premium-pricing-table-title' ); |
| 3541 | |
| 3542 | $this->add_inline_editing_attributes( 'premium_pricing_table_description_text', 'advanced' ); |
| 3543 | $this->add_render_attribute( 'premium_pricing_table_description_text', 'class', 'premium-pricing-description-container' ); |
| 3544 | |
| 3545 | $has_title = 'yes' === $settings['premium_pricing_table_title_switcher']; |
| 3546 | $price_enabled = 'yes' === $settings['premium_pricing_table_price_switcher']; |
| 3547 | |
| 3548 | if ( $has_title ) { |
| 3549 | $title_tag = Helper_Functions::validate_html_tag( $settings['premium_pricing_table_title_size'] ); |
| 3550 | } |
| 3551 | |
| 3552 | if ( 'yes' === $settings['premium_pricing_table_badge_switcher'] ) { |
| 3553 | $badge_position = 'premium-badge-' . $settings['premium_pricing_table_badge_position']; |
| 3554 | $badge_style = 'premium-badge-' . $settings['ribbon_type']; |
| 3555 | |
| 3556 | $this->add_inline_editing_attributes( 'premium_pricing_table_badge_text' ); |
| 3557 | |
| 3558 | // if ( 'premium-badge-flag' === $badge_style ) { |
| 3559 | // $badge_position = ''; |
| 3560 | // } |
| 3561 | } |
| 3562 | |
| 3563 | $link_type = $settings['premium_pricing_table_button_url_type']; |
| 3564 | |
| 3565 | if ( 'link' === $link_type ) { |
| 3566 | $link_url = get_permalink( $settings['premium_pricing_table_button_link_existing_content'] ); |
| 3567 | } elseif ( 'url' === $link_type ) { |
| 3568 | $link_url = $settings['premium_pricing_table_button_link']; |
| 3569 | } |
| 3570 | |
| 3571 | if ( ! empty( $link_url ) ) { |
| 3572 | |
| 3573 | $effect_class = Helper_Functions::get_button_class( $settings ); |
| 3574 | |
| 3575 | $this->add_render_attribute( |
| 3576 | 'button', |
| 3577 | array( |
| 3578 | 'class' => array( |
| 3579 | 'premium-pricing-price-button', |
| 3580 | $effect_class, |
| 3581 | ), |
| 3582 | 'data-text' => $settings['premium_pricing_table_button_text'], |
| 3583 | ) |
| 3584 | ); |
| 3585 | |
| 3586 | if ( 'link' === $link_type ) { |
| 3587 | $this->add_render_attribute( 'button', 'href', $link_url ); |
| 3588 | } else { |
| 3589 | $this->add_link_attributes( 'button', $link_url ); |
| 3590 | } |
| 3591 | } |
| 3592 | |
| 3593 | if ( 'yes' === $settings['premium_pricing_table_icon_switcher'] ) { |
| 3594 | $icon_type = $settings['icon_type']; |
| 3595 | |
| 3596 | if ( 'icon' === $icon_type || 'svg' === $icon_type ) { |
| 3597 | |
| 3598 | $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' ); |
| 3599 | |
| 3600 | if ( 'yes' === $settings['draw_svg'] ) { |
| 3601 | |
| 3602 | $this->add_render_attribute( |
| 3603 | 'container', |
| 3604 | 'class', |
| 3605 | array( |
| 3606 | 'elementor-invisible', |
| 3607 | 'premium-drawer-hover', |
| 3608 | ) |
| 3609 | ); |
| 3610 | |
| 3611 | $this->add_render_attribute( |
| 3612 | 'icon', |
| 3613 | array( |
| 3614 | 'class' => 'premium-svg-drawer', |
| 3615 | 'data-svg-reverse' => $settings['lottie_reverse'], |
| 3616 | 'data-svg-loop' => $settings['lottie_loop'], |
| 3617 | 'data-svg-sync' => $settings['svg_sync'], |
| 3618 | 'data-svg-hover' => $settings['svg_hover'], |
| 3619 | 'data-svg-fill' => $settings['svg_color'], |
| 3620 | 'data-svg-frames' => $settings['frames'], |
| 3621 | 'data-svg-yoyo' => $settings['svg_yoyo'], |
| 3622 | 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'], |
| 3623 | ) |
| 3624 | ); |
| 3625 | |
| 3626 | } else { |
| 3627 | $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' ); |
| 3628 | } |
| 3629 | } elseif ( 'animation' === $icon_type ) { |
| 3630 | $this->add_render_attribute( |
| 3631 | 'pricing_lottie', |
| 3632 | array( |
| 3633 | 'class' => array( |
| 3634 | 'premium-pricing-icon', |
| 3635 | 'premium-lottie-animation', |
| 3636 | ), |
| 3637 | 'data-lottie-url' => $settings['lottie_url'], |
| 3638 | 'data-lottie-loop' => $settings['lottie_loop'], |
| 3639 | 'data-lottie-reverse' => $settings['lottie_reverse'], |
| 3640 | ) |
| 3641 | ); |
| 3642 | } else { |
| 3643 | $this->add_render_attribute( |
| 3644 | 'pricing_img', |
| 3645 | array( |
| 3646 | 'src' => $settings['premium_pricing_table_image']['url'], |
| 3647 | 'alt' => Control_Media::get_image_alt( $settings['premium_pricing_table_image'] ), |
| 3648 | ) |
| 3649 | ); |
| 3650 | } |
| 3651 | } |
| 3652 | |
| 3653 | $this->add_render_attribute( 'container', 'class', 'premium-pricing-table-container' ); |
| 3654 | |
| 3655 | $draw_icon = $this->check_icon_draw(); |
| 3656 | if ( $draw_icon && 'yes' === $settings['draw_svgs_sequence'] ) { |
| 3657 | $this->add_render_attribute( 'container', 'data-speed', $settings['list_frames'] ); |
| 3658 | } |
| 3659 | |
| 3660 | if ( $price_enabled ) { |
| 3661 | $this->add_render_attribute( 'price_container', 'class', 'premium-pricing-price-container' ); |
| 3662 | |
| 3663 | if ( 'none' !== $settings['price_lq_effect'] ) { |
| 3664 | $this->add_render_attribute( 'price_container', 'class', 'premium-con-lq__' . $settings['price_lq_effect'] ); |
| 3665 | } |
| 3666 | |
| 3667 | $price = $settings['premium_pricing_table_price_value']; |
| 3668 | $slashed_price = $settings['premium_pricing_table_slashed_price_value']; |
| 3669 | $has_slashed_price = ! empty( $slashed_price ); |
| 3670 | $has_effect = ( 'effect-1' === $settings['price_effects'] ) && $has_slashed_price; |
| 3671 | $currency = $settings['premium_pricing_table_price_currency']; |
| 3672 | $separator = $settings['premium_pricing_table_price_separator']; |
| 3673 | $duration = $settings['premium_pricing_table_price_duration']; |
| 3674 | } |
| 3675 | |
| 3676 | ?> |
| 3677 | |
| 3678 | <div <?php $this->print_render_attribute_string( 'container' ); ?>> |
| 3679 | <?php if ( 'yes' === $settings['premium_pricing_table_badge_switcher'] ) : ?> |
| 3680 | <div class="premium-pricing-badge-container <?php echo esc_attr( $badge_position . ' ' . $badge_style ); ?>"> |
| 3681 | <div class="corner"> |
| 3682 | <span <?php $this->print_render_attribute_string( 'premium_pricing_table_badge_text' ); ?>> |
| 3683 | <?php echo wp_kses_post( $settings['premium_pricing_table_badge_text'] ); ?> |
| 3684 | </span> |
| 3685 | </div> |
| 3686 | </div> |
| 3687 | <?php |
| 3688 | endif; |
| 3689 | if ( 'yes' === $settings['premium_pricing_table_icon_switcher'] ) : |
| 3690 | ?> |
| 3691 | <div class="premium-pricing-icon-container"> |
| 3692 | <div class="premium-pricing-icon-wrapper"> |
| 3693 | <?php if ( 'icon' === $icon_type ) : ?> |
| 3694 | <?php |
| 3695 | if ( 'yes' !== $settings['draw_svg'] ) : |
| 3696 | Icons_Manager::render_icon( |
| 3697 | $settings['premium_pricing_table_icon_selection_updated'], |
| 3698 | array( |
| 3699 | 'class' => array( 'premium-svg-nodraw', 'premium-drawable-icon' ), |
| 3700 | 'aria-hidden' => 'true', |
| 3701 | ) |
| 3702 | ); |
| 3703 | else : |
| 3704 | echo Helper_Functions::get_svg_by_icon( |
| 3705 | $settings['premium_pricing_table_icon_selection_updated'], |
| 3706 | $this->get_render_attribute_string( 'icon' ) |
| 3707 | ); |
| 3708 | |
| 3709 | endif; |
| 3710 | ?> |
| 3711 | |
| 3712 | <?php elseif ( 'svg' === $icon_type ) : ?> |
| 3713 | <div <?php $this->print_render_attribute_string( 'icon' ); ?>> |
| 3714 | <?php echo Helper_Functions::sanitize_svg( $this->get_settings_for_display( 'custom_svg' ) ); ?> |
| 3715 | </div> |
| 3716 | <?php elseif ( 'animation' === $icon_type ) : ?> |
| 3717 | <div <?php $this->print_render_attribute_string( 'pricing_lottie' ); ?>></div> |
| 3718 | <?php else : ?> |
| 3719 | <div class='premium-pricing-image'> |
| 3720 | <img <?php $this->print_render_attribute_string( 'pricing_img' ); ?> /> |
| 3721 | </div> |
| 3722 | <?php endif; ?> |
| 3723 | </div> |
| 3724 | </div> |
| 3725 | <?php |
| 3726 | endif; |
| 3727 | |
| 3728 | if ( $has_title ) : |
| 3729 | ?> |
| 3730 | <<?php echo wp_kses_post( $title_tag ) . ' ' . wp_kses_post( $this->get_render_attribute_string( 'premium_pricing_table_title_text' ) ); ?>> |
| 3731 | <?php echo wp_kses_post( $settings['premium_pricing_table_title_text'] ); ?> |
| 3732 | </<?php echo wp_kses_post( $title_tag ); ?>> |
| 3733 | <?php endif; ?> |
| 3734 | |
| 3735 | <?php if ( $price_enabled ) : ?> |
| 3736 | <div <?php $this->print_render_attribute_string( 'price_container' ); ?>> |
| 3737 | <div class="premium-pricing-inner-wrapper <?php echo ( $has_effect ? esc_attr( 'premium-pricing-reveal-wrapper' ) : '' ); ?>"> |
| 3738 | <?php if ( $has_slashed_price ) : ?> |
| 3739 | <s class="premium-pricing-slashed-price-value"> |
| 3740 | <?php echo wp_kses_post( ( $has_effect ? $currency : '' ) . $slashed_price ); ?> |
| 3741 | </s> |
| 3742 | <?php endif; ?> |
| 3743 | |
| 3744 | <div class="premium-pricing-actual-wrapper"> |
| 3745 | <?php if ( ! empty( $currency ) ) : ?> |
| 3746 | <span class="premium-pricing-price-currency"><?php echo wp_kses_post( $currency ); ?></span> |
| 3747 | <?php endif; ?> |
| 3748 | <?php if ( ! empty( $price ) ) : ?> |
| 3749 | <span class="premium-pricing-price-value"><?php echo wp_kses_post( $price ); ?></span> |
| 3750 | <?php endif; ?> |
| 3751 | </div> |
| 3752 | </div> |
| 3753 | |
| 3754 | <div class="separate-duration-wrapper"> |
| 3755 | <?php if ( ! empty( $separator ) ) : ?> |
| 3756 | <span class="premium-pricing-price-separator"> |
| 3757 | <?php echo wp_kses_post( $separator ); ?> |
| 3758 | </span> |
| 3759 | <?php endif; ?> |
| 3760 | |
| 3761 | <?php if ( ! empty( $duration ) ) : ?> |
| 3762 | <span class="premium-pricing-price-duration"> |
| 3763 | <?php echo wp_kses_post( $duration ); ?> |
| 3764 | </span> |
| 3765 | <?php endif; ?> |
| 3766 | </div> |
| 3767 | </div> |
| 3768 | <?php |
| 3769 | endif; |
| 3770 | if ( 'yes' === $settings['premium_pricing_table_list_switcher'] ) : |
| 3771 | ?> |
| 3772 | <ul class="premium-pricing-list"> |
| 3773 | <?php |
| 3774 | foreach ( $settings['premium_fancy_text_list_items'] as $index => $item ) : |
| 3775 | |
| 3776 | $key = 'pricing_list_item_' . $index; |
| 3777 | |
| 3778 | if ( 'icon' === $item['icon_type'] ) : |
| 3779 | $icon_migrated = isset( $item['__fa4_migrated']['premium_pricing_list_item_icon_updated'] ); |
| 3780 | $icon_new = empty( $item['premium_pricing_list_item_icon'] ) && Icons_Manager::is_migration_allowed(); |
| 3781 | endif; |
| 3782 | |
| 3783 | $this->add_render_attribute( |
| 3784 | $key, |
| 3785 | array( |
| 3786 | 'class' => array( |
| 3787 | 'elementor-repeater-item-' . $item['_id'], |
| 3788 | 'premium-pricing-list-item', |
| 3789 | ), |
| 3790 | ) |
| 3791 | ); |
| 3792 | |
| 3793 | if ( 'icon' === $item['icon_type'] || 'svg' === $item['icon_type'] ) { |
| 3794 | |
| 3795 | $this->add_render_attribute( $key, 'class', 'premium-drawable-icon' ); |
| 3796 | |
| 3797 | if ( 'yes' === $item['draw_svg'] ) { |
| 3798 | |
| 3799 | $this->add_render_attribute( |
| 3800 | $key, |
| 3801 | array( |
| 3802 | 'class' => array( 'premium-svg-drawer', 'elementor-invisible' ), |
| 3803 | 'data-svg-reverse' => $item['lottie_reverse'], |
| 3804 | 'data-svg-loop' => $item['lottie_loop'], |
| 3805 | 'data-svg-hover' => $item['svg_hover'], |
| 3806 | 'data-svg-sync' => $item['svg_sync'], |
| 3807 | 'data-svg-fill' => $item['svg_color'], |
| 3808 | 'data-svg-frames' => $item['frames'], |
| 3809 | 'data-svg-yoyo' => $item['svg_yoyo'], |
| 3810 | 'data-svg-point' => $item['lottie_reverse'] ? $item['end_point']['size'] : $item['start_point']['size'], |
| 3811 | ) |
| 3812 | ); |
| 3813 | |
| 3814 | } else { |
| 3815 | $this->add_render_attribute( $key, 'class', 'premium-svg-nodraw' ); |
| 3816 | } |
| 3817 | } |
| 3818 | |
| 3819 | ?> |
| 3820 | <li <?php $this->print_render_attribute_string( $key ); ?>> |
| 3821 | <?php if ( 'icon' === $item['icon_type'] ) : ?> |
| 3822 | <?php |
| 3823 | |
| 3824 | if ( ( $icon_new || $icon_migrated ) && 'yes' !== $item['draw_svg'] ) : |
| 3825 | Icons_Manager::render_icon( |
| 3826 | $item['premium_pricing_list_item_icon_updated'], |
| 3827 | array( |
| 3828 | 'class' => array( 'premium-pricing-feature-icon', 'premium-svg-nodraw', 'premium-drawable-icon' ), |
| 3829 | 'aria-hidden' => 'true', |
| 3830 | ) |
| 3831 | ); |
| 3832 | else : |
| 3833 | echo Helper_Functions::get_svg_by_icon( |
| 3834 | $item['premium_pricing_list_item_icon_updated'], |
| 3835 | array( |
| 3836 | 'class' => 'premium-pricing-feature-icon', |
| 3837 | ) |
| 3838 | ); |
| 3839 | |
| 3840 | endif; |
| 3841 | ?> |
| 3842 | <?php elseif ( 'svg' === $item['icon_type'] ) : ?> |
| 3843 | <?php echo Helper_Functions::sanitize_svg( $item['custom_svg'] ); ?> |
| 3844 | <?php |
| 3845 | elseif ( 'animation' === $item['icon_type'] ) : |
| 3846 | $lottie_key = 'pricing_item_lottie_' . $index; |
| 3847 | $this->add_render_attribute( |
| 3848 | $lottie_key, |
| 3849 | array( |
| 3850 | 'class' => array( |
| 3851 | 'premium-pricing-feature-icon', |
| 3852 | 'premium-lottie-animation', |
| 3853 | ), |
| 3854 | 'data-lottie-url' => $item['lottie_url'], |
| 3855 | 'data-lottie-loop' => $item['lottie_loop'], |
| 3856 | 'data-lottie-reverse' => $item['lottie_reverse'], |
| 3857 | ) |
| 3858 | ); |
| 3859 | ?> |
| 3860 | <div <?php $this->print_render_attribute_string( $lottie_key ); ?>></div> |
| 3861 | <?php |
| 3862 | else : |
| 3863 | $img_key = 'pricing_list_img' . $index; |
| 3864 | $this->add_render_attribute( |
| 3865 | $img_key, |
| 3866 | array( |
| 3867 | 'src' => $item['premium_pricing_list_image']['url'], |
| 3868 | 'alt' => Control_Media::get_image_alt( $item['premium_pricing_list_image'] ), |
| 3869 | ) |
| 3870 | ); |
| 3871 | ?> |
| 3872 | <div class='premium-pricing-list-image premium-pricing-feature-icon'> |
| 3873 | <img <?php $this->print_render_attribute_string( $img_key ); ?> /> |
| 3874 | </div> |
| 3875 | <?php endif; ?> |
| 3876 | |
| 3877 | <?php |
| 3878 | if ( ! empty( $item['premium_pricing_list_item_text'] ) ) : |
| 3879 | $item_class = 'yes' === $item['premium_pricing_table_item_tooltip'] ? ' list-item-tooltip' : ''; |
| 3880 | ?> |
| 3881 | <span class="premium-pricing-list-span<?php echo esc_attr( $item_class ); ?>"> |
| 3882 | <?php |
| 3883 | echo wp_kses_post( $item['premium_pricing_list_item_text'] ); |
| 3884 | if ( 'yes' === $item['premium_pricing_table_item_tooltip'] && ! empty( $item['premium_pricing_table_item_tooltip_text'] ) ) : |
| 3885 | ?> |
| 3886 | <span class="premium-pricing-list-tooltip"><?php echo wp_kses_post( $item['premium_pricing_table_item_tooltip_text'] ); ?></span> |
| 3887 | <?php endif; ?> |
| 3888 | </span> |
| 3889 | <?php endif; ?> |
| 3890 | </li> |
| 3891 | <?php endforeach; ?> |
| 3892 | </ul> |
| 3893 | <?php endif; ?> |
| 3894 | <?php if ( 'yes' === $settings['premium_pricing_table_description_switcher'] ) : ?> |
| 3895 | <div <?php $this->print_render_attribute_string( 'premium_pricing_table_description_text' ); ?>> |
| 3896 | <?php echo $this->parse_text_editor( $settings['premium_pricing_table_description_text'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 3897 | </div> |
| 3898 | <?php endif; ?> |
| 3899 | <?php if ( 'yes' === $settings['premium_pricing_table_button_switcher'] ) : ?> |
| 3900 | <div class="premium-pricing-button-container"> |
| 3901 | <a <?php $this->print_render_attribute_string( 'button' ); ?>> |
| 3902 | <div class="premium-button-text-icon-wrapper"> |
| 3903 | <span><?php echo wp_kses_post( $settings['premium_pricing_table_button_text'] ); ?></span> |
| 3904 | </div> |
| 3905 | <?php if ( 'style6' === $settings['premium_button_hover_effect'] && 'yes' === $settings['mouse_detect'] ) : ?> |
| 3906 | <span class="premium-button-style6-bg"></span> |
| 3907 | <?php endif; ?> |
| 3908 | |
| 3909 | <?php if ( 'style8' === $settings['premium_button_hover_effect'] ) : ?> |
| 3910 | <?php echo Helper_Functions::get_btn_svgs( $settings['underline_style'] ); ?> |
| 3911 | <?php endif; ?> |
| 3912 | |
| 3913 | </a> |
| 3914 | </div> |
| 3915 | <?php endif; ?> |
| 3916 | </div> |
| 3917 | |
| 3918 | <?php |
| 3919 | } |
| 3920 | |
| 3921 | /** |
| 3922 | * Render Pricing Table widget output in the editor. |
| 3923 | * |
| 3924 | * Written as a Backbone JavaScript template and used to generate the live preview. |
| 3925 | * |
| 3926 | * @since 1.0.0 |
| 3927 | * @access protected |
| 3928 | */ |
| 3929 | protected function content_template() {} |
| 3930 | } |
| 3931 |