register_content_controls(); $this->register_style_controls(); } // ── Content ────────────────────────────────────────────────────────────── private function register_content_controls(): void { /* ── General ─────────────────────────────────── */ $this->start_controls_section( 'section_general', [ 'label' => __( 'General', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'billing_toggle', [ 'label' => __( 'Monthly / Yearly Toggle', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_control( 'monthly_label', [ 'label' => __( 'Monthly Label', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Monthly', 'admore-widgets-suite' ), 'condition' => [ 'billing_toggle' => 'yes' ], ] ); $this->add_control( 'yearly_label', [ 'label' => __( 'Yearly Label', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Yearly', 'admore-widgets-suite' ), 'condition' => [ 'billing_toggle' => 'yes' ], ] ); $this->add_control( 'yearly_badge', [ 'label' => __( 'Yearly Savings Badge', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Save 20%', 'admore-widgets-suite' ), 'condition' => [ 'billing_toggle' => 'yes' ], ] ); $this->add_control( 'comparison_mode', [ 'label' => __( 'Comparison Mode', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __( 'Renders a full-width comparison table layout.', 'admore-widgets-suite' ), 'return_value' => 'yes', ] ); $this->add_responsive_control( 'columns', [ 'label' => __( 'Columns', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-grid' => 'grid-template-columns: repeat({{VALUE}}, 1fr);', ], ] ); $this->end_controls_section(); /* ── Plans (repeater) ─────────────────────────── */ $this->start_controls_section( 'section_plans', [ 'label' => __( 'Plans', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'plan_name', [ 'label' => __( 'Plan Name', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Pro', 'admore-widgets-suite' ), 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'plan_description', [ 'label' => __( 'Subtitle', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'For professionals', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'plan_icon', [ 'label' => __( 'Plan Icon', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::ICONS, ] ); $repeater->add_control( 'currency', [ 'label' => __( 'Currency Symbol', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '$', ] ); $repeater->add_control( 'price_monthly', [ 'label' => __( 'Monthly Price', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '29', ] ); $repeater->add_control( 'price_yearly', [ 'label' => __( 'Yearly Price', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '279', ] ); $repeater->add_control( 'original_price', [ 'label' => __( 'Original Price (strikethrough)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => __( 'Leave empty to hide. Shows as crossed-out price.', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'price_suffix', [ 'label' => __( 'Price Suffix', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '/mo', ] ); $repeater->add_control( 'price_suffix_yearly', [ 'label' => __( 'Yearly Price Suffix', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => '/yr', ] ); $repeater->add_control( 'is_popular', [ 'label' => __( 'Most Popular', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', ] ); $repeater->add_control( 'popular_label', [ 'label' => __( 'Badge Text', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Most Popular', 'admore-widgets-suite' ), 'condition' => [ 'is_popular' => 'yes' ], ] ); $repeater->add_control( 'ribbon_position', [ 'label' => __( 'Badge Position', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'top', 'options' => [ 'top' => __( 'Top Center', 'admore-widgets-suite' ), 'top-right' => __( 'Top Right Corner', 'admore-widgets-suite' ), 'top-left' => __( 'Top Left Corner', 'admore-widgets-suite' ), 'side-ribbon' => __( 'Side Ribbon', 'admore-widgets-suite' ), ], 'condition' => [ 'is_popular' => 'yes' ], ] ); $repeater->add_control( 'features_list', [ 'label' => __( 'Monthly Features (one per line)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => "10 Projects\n50 GB Storage\nPriority Support\nCustom Domain", 'description' => __( 'Prefix with - to show as unavailable. Add |tooltip text after feature for tooltip.', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'features_list_yearly', [ 'label' => __( 'Yearly Features (one per line)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => "Unlimited Projects\n100 GB Storage\nPriority Support\nCustom Domain\n-Premium Templates", 'description' => __( 'Leave empty to use monthly features. Prefix with - to show as unavailable.', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'button_text', [ 'label' => __( 'Button Text', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Get Started', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'button_icon', [ 'label' => __( 'Button Icon', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::ICONS, ] ); $repeater->add_control( 'button_link', [ 'label' => __( 'Button Link', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::URL, 'dynamic' => [ 'active' => true ], ] ); $repeater->add_control( 'footer_note', [ 'label' => __( 'Footer Note', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __( 'e.g. No credit card required', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'plan_custom_bg_heading', [ 'label' => __( 'Custom Card Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $repeater->add_control( 'plan_bg_color', [ 'label' => __( 'Card Background Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'description' => __( 'Overrides the global card background for this plan only.', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'plan_header_bg_color', [ 'label' => __( 'Header Background Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'description' => __( 'Overrides the header area background for this plan only.', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'secondary_btn_heading', [ 'label' => __( 'Secondary Button', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $repeater->add_control( 'secondary_button_text', [ 'label' => __( 'Secondary Button Text', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __( 'e.g. Try for Free', 'admore-widgets-suite' ), ] ); $repeater->add_control( 'secondary_button_link', [ 'label' => __( 'Secondary Button Link', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::URL, 'dynamic' => [ 'active' => true ], 'condition' => [ 'secondary_button_text!' => '' ], ] ); $this->add_control( 'plans', [ 'label' => __( 'Pricing Plans', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'plan_name' => __( 'Basic', 'admore-widgets-suite' ), 'plan_description' => __( 'For individuals', 'admore-widgets-suite' ), 'price_monthly' => '9', 'price_yearly' => '89', 'features_list' => "3 Projects\n10 GB Storage\nEmail Support\n-Custom Domain", 'features_list_yearly' => "5 Projects\n20 GB Storage\nEmail Support\nCustom Domain", 'button_text' => __( 'Get Started', 'admore-widgets-suite' ), ], [ 'plan_name' => __( 'Pro', 'admore-widgets-suite' ), 'plan_description' => __( 'For professionals', 'admore-widgets-suite' ), 'price_monthly' => '29', 'price_yearly' => '279', 'is_popular' => 'yes', 'features_list' => "10 Projects\n50 GB Storage\nPriority Support\nCustom Domain", 'features_list_yearly' => "25 Projects\n100 GB Storage\nPriority Support\nCustom Domain\nAdvanced Analytics", 'button_text' => __( 'Get Started', 'admore-widgets-suite' ), ], [ 'plan_name' => __( 'Enterprise', 'admore-widgets-suite' ), 'plan_description' => __( 'For teams', 'admore-widgets-suite' ), 'price_monthly' => '79', 'price_yearly' => '749', 'features_list' => "Unlimited Projects\n500 GB Storage\n24/7 Phone Support\nCustom Domain\nSSO & SAML", 'features_list_yearly' => "Unlimited Projects\n1 TB Storage\n24/7 Dedicated Support\nCustom Domain\nSSO & SAML\nAPI Access\nWhite Label", 'button_text' => __( 'Contact Sales', 'admore-widgets-suite' ), ], ], 'title_field' => '{{{ plan_name }}}', ] ); $this->end_controls_section(); /* ── Hover Animation ─────────────────────────── */ $this->start_controls_section( 'section_hover', [ 'label' => __( 'Hover Effects', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'hover_effect', [ 'label' => __( 'Hover Animation', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'lift', 'options' => [ 'none' => __( 'None', 'admore-widgets-suite' ), 'lift' => __( 'Lift', 'admore-widgets-suite' ), 'glow' => __( 'Glow', 'admore-widgets-suite' ), 'zoom' => __( 'Zoom', 'admore-widgets-suite' ), ], ] ); $this->end_controls_section(); } // ── Style ──────────────────────────────────────────────────────────────── private function register_style_controls(): void { /* ── Card Style ──────────────────────────────── */ $this->start_controls_section( 'section_style_card', [ 'label' => __( 'Card', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'card_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eppro-pricing-card', ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'popular_card_background', 'label' => __( 'Popular Plan Background', 'admore-widgets-suite' ), 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .eppro-pricing-card--popular', ] ); $this->add_control( 'header_bg', [ 'label' => __( 'Header Area Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-header' => 'background-color: {{VALUE}};' ], 'separator' => 'before', ] ); $this->add_responsive_control( 'header_padding', [ 'label' => __( 'Header Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'show_dividers', [ 'label' => __( 'Show Dividers', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'divider_color', [ 'label' => __( 'Divider Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e5e7eb', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-divider' => 'border-color: {{VALUE}};' ], 'condition' => [ 'show_dividers' => 'yes' ], ] ); $this->add_control( 'divider_style', [ 'label' => __( 'Divider Style', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'solid', 'options' => [ 'solid' => __( 'Solid', 'admore-widgets-suite' ), 'dashed' => __( 'Dashed', 'admore-widgets-suite' ), 'dotted' => __( 'Dotted', 'admore-widgets-suite' ), ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-divider' => 'border-style: {{VALUE}};' ], 'condition' => [ 'show_dividers' => 'yes' ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'card_border', 'selector' => '{{WRAPPER}} .eppro-pricing-card', ] ); $this->add_responsive_control( 'card_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'card_shadow', 'selector' => '{{WRAPPER}} .eppro-pricing-card', ] ); $this->add_responsive_control( 'card_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '32', 'right' => '28', 'bottom' => '32', 'left' => '28', 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'grid_gap', [ 'label' => __( 'Gap Between Cards', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'default' => [ 'size' => 24 ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-grid' => 'gap: {{SIZE}}{{UNIT}};' ], ] ); $this->add_control( 'card_hover_heading', [ 'label' => __( 'Hover Effects', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'card_hover_bg', [ 'label' => __( 'Hover Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card:hover' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'card_hover_shadow', 'label' => __( 'Hover Shadow', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pricing-card:hover', ] ); $this->add_control( 'card_hover_scale', [ 'label' => __( 'Hover Scale', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 1, 'max' => 1.15, 'step' => 0.01 ] ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card:hover' => 'transform: scale({{SIZE}});' ], ] ); $this->add_control( 'card_hover_border_color', [ 'label' => __( 'Hover Border Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card:hover' => 'border-color: {{VALUE}};' ], ] ); $this->add_control( 'popular_heading', [ 'label' => __( 'Popular Card', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'popular_border_color', [ 'label' => __( 'Border Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card--popular' => 'border: 2px solid {{VALUE}};' ], ] ); $this->add_control( 'popular_scale', [ 'label' => __( 'Scale Up', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 1, 'max' => 1.15, 'step' => 0.01 ] ], 'default' => [ 'size' => 1.05 ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-card--popular' => 'transform: scale({{SIZE}});' ], ] ); $this->add_control( 'tooltip_heading', [ 'label' => __( 'Feature Tooltips', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'tooltip_bg', [ 'label' => __( 'Tooltip Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#1f2937', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-tooltip::after' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'tooltip_text_color', [ 'label' => __( 'Tooltip Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-tooltip::after' => 'color: {{VALUE}};' ], ] ); $this->end_controls_section(); /* ── Toggle Style ────────────────────────────── */ $this->start_controls_section( 'section_style_toggle', [ 'label' => __( 'Billing Toggle', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'billing_toggle' => 'yes' ], ] ); $this->add_control( 'toggle_bg', [ 'label' => __( 'Track Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e5e7eb', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-toggle-track' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'toggle_active_bg', [ 'label' => __( 'Track Active Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pricing-toggle-track.active' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'toggle_typo', 'selector' => '{{WRAPPER}} .eppro-pricing-toggle-label', ] ); $this->end_controls_section(); /* ── Badge Style ─────────────────────────────── */ $this->start_controls_section( 'section_style_badge', [ 'label' => __( 'Popular Badge', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'badge_bg', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pricing-badge' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'badge_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-badge' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'badge_typo', 'selector' => '{{WRAPPER}} .eppro-pricing-badge', ] ); $this->add_responsive_control( 'badge_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* ── Typography ──────────────────────────────── */ $this->start_controls_section( 'section_style_typo', [ 'label' => __( 'Typography', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'plan_name_typo', 'label' => __( 'Plan Name', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pricing-plan-name', ] ); $this->add_control( 'plan_name_color', [ 'label' => __( 'Plan Name Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-plan-name' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_typo', 'label' => __( 'Price', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pricing-amount', ] ); $this->add_control( 'price_color', [ 'label' => __( 'Price Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-amount' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'feature_typo', 'label' => __( 'Features', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pricing-feature', ] ); $this->add_control( 'feature_color', [ 'label' => __( 'Feature Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-feature' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'disabled_feature_color', [ 'label' => __( 'Disabled Feature Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#9ca3af', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-feature--disabled' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'feature_icon_color', [ 'label' => __( 'Feature Icon Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#22c55e', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-feature-icon' => 'color: {{VALUE}}; stroke: {{VALUE}};' ], 'separator' => 'before', ] ); $this->add_control( 'disabled_icon_color', [ 'label' => __( 'Disabled Icon Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#d1d5db', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-feature--disabled .eppro-pricing-feature-icon' => 'color: {{VALUE}}; stroke: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'subtitle_typo', 'label' => __( 'Subtitle', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-pricing-subtitle', 'separator' => 'before', ] ); $this->add_control( 'subtitle_color', [ 'label' => __( 'Subtitle Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'subtitle_bg_color', [ 'label' => __( 'Subtitle Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'background-color: {{VALUE}};' ], ] ); $this->add_responsive_control( 'subtitle_alignment', [ 'label' => __( 'Alignment', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => __( 'Left', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => __( 'Center', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-center' ], 'right' => [ 'title' => __( 'Right', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-right' ], ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'text-align: {{VALUE}};' ], 'separator' => 'before', ] ); $this->add_responsive_control( 'subtitle_max_width', [ 'label' => __( 'Max Width', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 50, 'max' => 600 ], '%' => [ 'min' => 10, 'max' => 100 ] ], 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'max-width: {{SIZE}}{{UNIT}}; margin-left: auto; margin-right: auto;' ], ] ); $this->add_responsive_control( 'subtitle_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], 'separator' => 'before', ] ); $this->add_control( 'subtitle_border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50 ] ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-subtitle' => 'border-radius: {{SIZE}}px;' ], ] ); $this->add_control( 'original_price_color', [ 'label' => __( 'Strikethrough Price Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#9ca3af', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-original' => 'color: {{VALUE}};' ], 'separator' => 'before', ] ); $this->add_control( 'suffix_color', [ 'label' => __( 'Price Suffix Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-suffix' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'currency_color', [ 'label' => __( 'Currency Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-currency' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'footer_note_color', [ 'label' => __( 'Footer Note Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#6b7280', 'selectors' => [ '{{WRAPPER}} .eppro-pricing-footer-note' => 'color: {{VALUE}};' ], 'separator' => 'before', ] ); $this->end_controls_section(); /* ── Button Style ────────────────────────────── */ $this->start_controls_section( 'section_style_button', [ 'label' => __( 'Button', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'btn_typo', 'selector' => '{{WRAPPER}} .eppro-pricing-btn', ] ); $this->start_controls_tabs( 'btn_tabs' ); $this->start_controls_tab( 'btn_normal', [ 'label' => __( 'Normal', 'admore-widgets-suite' ) ] ); $this->add_control( 'btn_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'btn_bg', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn' => 'background-color: {{VALUE}};' ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'btn_hover', [ 'label' => __( 'Hover', 'admore-widgets-suite' ) ] ); $this->add_control( 'btn_hover_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn:hover' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'btn_hover_bg', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn:hover' => 'background-color: {{VALUE}};' ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'btn_border', 'selector' => '{{WRAPPER}} .eppro-pricing-btn', 'separator' => 'before', ] ); $this->add_responsive_control( 'btn_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .eppro-pricing-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /* ── Spacing ─────────────────────────────────── */ $this->start_controls_section( 'section_style_spacing', [ 'label' => __( 'Spacing', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->eppro_register_spacing_controls( '.eppro-pricing-wrap' ); $this->end_controls_section(); // Entrance animation — inherited from base $this->eppro_register_entrance_animation_controls(); } // ========================================================================= // Render // ========================================================================= protected function render(): void { $s = $this->get_settings_for_display(); $plans = $s['plans'] ?? []; $has_toggle = 'yes' === ( $s['billing_toggle'] ?? '' ); $hover = sanitize_key( $s['hover_effect'] ?? 'lift' ); $comparison = 'yes' === ( $s['comparison_mode'] ?? '' ); $show_divider = 'yes' === ( $s['show_dividers'] ?? 'yes' ); if ( empty( $plans ) ) { if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) { echo '

' . esc_html__( 'Pricing Table', 'admore-widgets-suite' ) . '

' . esc_html__( 'Add pricing plans in the Content tab.', 'admore-widgets-suite' ) . '

'; } return; } $wrap_class = 'eppro-pricing-wrap'; if ( $comparison ) $wrap_class .= ' eppro-pricing--comparison'; if ( $show_divider ) $wrap_class .= ' eppro-pricing--has-dividers'; ?>
$plan ) : $popular = 'yes' === ( $plan['is_popular'] ?? '' ); $card_class = 'eppro-pricing-card'; if ( $popular ) $card_class .= ' eppro-pricing-card--popular'; if ( 'none' !== $hover ) $card_class .= ' eppro-pricing-hover--' . $hover; $ribbon_pos = sanitize_key( $plan['ribbon_position'] ?? 'top' ); $features_monthly_raw = $plan['features_list'] ?? ''; $features_yearly_raw = $plan['features_list_yearly'] ?? ''; // If yearly features empty, use monthly features if ( empty( trim( $features_yearly_raw ) ) ) { $features_yearly_raw = $features_monthly_raw; } $features_monthly = array_filter( array_map( 'trim', explode( "\n", $features_monthly_raw ) ) ); $features_yearly = array_filter( array_map( 'trim', explode( "\n", $features_yearly_raw ) ) ); $link_url = $plan['button_link']['url'] ?? '#'; $link_target = ! empty( $plan['button_link']['is_external'] ) ? ' target="_blank" rel="noopener noreferrer"' : ''; $card_inline_style = ''; $header_inline_style = ''; if ( ! empty( $plan['plan_bg_color'] ) ) { $card_inline_style = ' style="background-color:' . esc_attr( $plan['plan_bg_color'] ) . ';"'; } if ( ! empty( $plan['plan_header_bg_color'] ) ) { $header_inline_style = ' style="background-color:' . esc_attr( $plan['plan_header_bg_color'] ) . ';"'; } ?>