__( 'Monday', 'a1-tools' ), 'tue' => __( 'Tuesday', 'a1-tools' ), 'wed' => __( 'Wednesday', 'a1-tools' ), 'thu' => __( 'Thursday', 'a1-tools' ), 'fri' => __( 'Friday', 'a1-tools' ), 'sat' => __( 'Saturday', 'a1-tools' ), 'sun' => __( 'Sunday', 'a1-tools' ), ); } // ──────────────────────────────────────────────────────────────── // Controls // ──────────────────────────────────────────────────────────────── protected function register_controls() { // ── Content: Phone ────────────────────────────────────────── $this->start_controls_section( 'phone_section', array( 'label' => __( 'Phone', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'show_phone', array( 'label' => __( 'Show Phone', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ) ); $this->add_control( 'phone_icon', array( 'label' => __( 'Icon', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => array( 'value' => 'fas fa-phone-alt', 'library' => 'fa-solid' ), 'condition' => array( 'show_phone' => 'yes' ), ) ); $this->add_control( 'phone_title', array( 'label' => __( 'Title', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Phone', 'a1-tools' ), 'condition' => array( 'show_phone' => 'yes' ), ) ); $this->add_control( 'phone_link', array( 'label' => __( 'Click-to-call Link', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'condition' => array( 'show_phone' => 'yes' ), ) ); $this->end_controls_section(); // ── Content: Email ────────────────────────────────────────── $this->start_controls_section( 'email_section', array( 'label' => __( 'Email', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'show_email', array( 'label' => __( 'Show Email', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ) ); $this->add_control( 'email_icon', array( 'label' => __( 'Icon', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => array( 'value' => 'fas fa-envelope', 'library' => 'fa-solid' ), 'condition' => array( 'show_email' => 'yes' ), ) ); $this->add_control( 'email_title', array( 'label' => __( 'Title', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Email', 'a1-tools' ), 'condition' => array( 'show_email' => 'yes' ), ) ); $this->add_control( 'email_link', array( 'label' => __( 'Mailto Link', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'condition' => array( 'show_email' => 'yes' ), ) ); $this->end_controls_section(); // ── Content: Location ─────────────────────────────────────── $this->start_controls_section( 'location_section', array( 'label' => __( 'Location', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'show_location', array( 'label' => __( 'Show Location', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ) ); $this->add_control( 'location_icon', array( 'label' => __( 'Icon', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => array( 'value' => 'fas fa-map-marker-alt', 'library' => 'fa-solid' ), 'condition' => array( 'show_location' => 'yes' ), ) ); $this->add_control( 'location_title', array( 'label' => __( 'Title', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Location', 'a1-tools' ), 'condition' => array( 'show_location' => 'yes' ), ) ); $this->add_control( 'location_link', array( 'label' => __( 'Google Maps Link', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'condition' => array( 'show_location' => 'yes' ), ) ); $this->end_controls_section(); // ── Content: Hours ────────────────────────────────────────── $this->start_controls_section( 'hours_section', array( 'label' => __( 'Hours', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'show_hours', array( 'label' => __( 'Show Hours', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ) ); $this->add_control( 'hours_icon', array( 'label' => __( 'Icon', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => array( 'value' => 'far fa-clock', 'library' => 'fa-regular' ), 'condition' => array( 'show_hours' => 'yes' ), ) ); $this->add_control( 'hours_title', array( 'label' => __( 'Title', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Hours', 'a1-tools' ), 'condition' => array( 'show_hours' => 'yes' ), ) ); $this->add_control( 'hours_closed_text', array( 'label' => __( 'Closed Text', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Closed', 'a1-tools' ), 'condition' => array( 'show_hours' => 'yes' ), ) ); $this->add_control( 'hours_hide_closed', array( 'label' => __( 'Hide Closed Days', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => '', 'condition' => array( 'show_hours' => 'yes' ), ) ); $this->end_controls_section(); // ── Content: License ──────────────────────────────────────── $this->start_controls_section( 'license_section', array( 'label' => __( 'License', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'show_license', array( 'label' => __( 'Show License', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ) ); $this->add_control( 'license_icon', array( 'label' => __( 'Icon', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => array( 'value' => 'fas fa-certificate', 'library' => 'fa-solid' ), 'condition' => array( 'show_license' => 'yes' ), ) ); $this->add_control( 'license_title', array( 'label' => __( 'Title', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'License', 'a1-tools' ), 'condition' => array( 'show_license' => 'yes' ), ) ); $this->end_controls_section(); // ── Style: Icon ───────────────────────────────────────────── $this->start_controls_section( 'icon_style', array( 'label' => __( 'Icon', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_control( 'icon_color', array( 'label' => __( 'Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#E53935', 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-icon' => 'color: {{VALUE}};', '{{WRAPPER}} .a1tools-info-box-icon svg' => 'fill: {{VALUE}};', ), ) ); $this->add_control( 'icon_size', array( 'label' => __( 'Size', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 12, 'max' => 80 ) ), 'default' => array( 'unit' => 'px', 'size' => 28 ), 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-icon' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .a1tools-info-box-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ), ) ); $this->add_control( 'icon_bg_heading', array( 'label' => __( 'Background', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'icon_bg_color', array( 'label' => __( 'Background Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-icon' => 'background-color: {{VALUE}};', ), ) ); $this->add_control( 'icon_padding', array( 'label' => __( 'Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px' ), 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->add_control( 'icon_border_heading', array( 'label' => __( 'Border', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( 'name' => 'icon_border', 'label' => __( 'Border', 'a1-tools' ), 'selector' => '{{WRAPPER}} .a1tools-info-box-icon', ) ); $this->add_control( 'icon_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px', '%' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 50 ), '%' => array( 'min' => 0, 'max' => 50 ), ), 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-icon' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->add_control( 'icon_gap', array( 'label' => __( 'Spacing', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 40 ) ), 'default' => array( 'unit' => 'px', 'size' => 12 ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-item' => 'gap: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); // ── Style: Content ────────────────────────────────────────── $this->start_controls_section( 'content_style', array( 'label' => __( 'Content', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_responsive_control( 'alignment', array( 'label' => __( 'Alignment', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => array( 'left' => array( 'title' => __( 'Left', 'a1-tools' ), 'icon' => 'eicon-text-align-left' ), 'center' => array( 'title' => __( 'Center', 'a1-tools' ), 'icon' => 'eicon-text-align-center' ), 'right' => array( 'title' => __( 'Right', 'a1-tools' ), 'icon' => 'eicon-text-align-right' ), ), 'default' => 'left', 'selectors_dictionary' => array( 'left' => 'flex-start', 'center' => 'center', 'right' => 'flex-end' ), 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-item' => 'justify-content: {{VALUE}};', ), ) ); $this->add_responsive_control( 'vertical_alignment', array( 'label' => __( 'Vertical Alignment', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => array( 'flex-start' => array( 'title' => __( 'Top', 'a1-tools' ), 'icon' => 'eicon-v-align-top' ), 'center' => array( 'title' => __( 'Middle', 'a1-tools' ), 'icon' => 'eicon-v-align-middle' ), 'flex-end' => array( 'title' => __( 'Bottom', 'a1-tools' ), 'icon' => 'eicon-v-align-bottom' ), ), 'default' => 'flex-start', 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-item' => 'align-items: {{VALUE}};', ), ) ); $this->add_control( 'title_color', array( 'label' => __( 'Title Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-title' => 'color: {{VALUE}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'title_typography', 'label' => __( 'Title Typography', 'a1-tools' ), 'selector' => '{{WRAPPER}} .a1tools-info-box-title', ) ); $this->add_control( 'value_color', array( 'label' => __( 'Value Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-value' => 'color: {{VALUE}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'value_typography', 'label' => __( 'Value Typography', 'a1-tools' ), 'selector' => '{{WRAPPER}} .a1tools-info-box-value', ) ); $this->add_control( 'link_heading', array( 'label' => __( 'Link', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'link_underline', array( 'label' => __( 'Underline', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'none', 'options' => array( 'none' => __( 'None', 'a1-tools' ), 'underline' => __( 'Always', 'a1-tools' ), 'hover' => __( 'On Hover', 'a1-tools' ), ), 'selectors_dictionary' => array( 'none' => 'none', 'underline' => 'underline', 'hover' => 'none', ), 'selectors' => array( '{{WRAPPER}} a.a1tools-info-box-link .a1tools-info-box-value' => 'text-decoration: {{VALUE}};', ), ) ); $this->add_control( 'hover_heading', array( 'label' => __( 'Hover', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ) ); $this->add_control( 'hover_icon_color', array( 'label' => __( 'Icon Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} a.a1tools-info-box-link:hover .a1tools-info-box-icon' => 'color: {{VALUE}};', '{{WRAPPER}} a.a1tools-info-box-link:hover .a1tools-info-box-icon svg' => 'fill: {{VALUE}};', ), ) ); $this->add_control( 'hover_title_color', array( 'label' => __( 'Title Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} a.a1tools-info-box-link:hover .a1tools-info-box-title' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'hover_value_color', array( 'label' => __( 'Value Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} a.a1tools-info-box-link:hover .a1tools-info-box-value' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'title_value_gap', array( 'label' => __( 'Title / Value Gap', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 20 ) ), 'default' => array( 'unit' => 'px', 'size' => 2 ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-info-box-content' => 'gap: {{SIZE}}{{UNIT}};' ), ) ); $this->end_controls_section(); // ── Style: Hours ──────────────────────────────────────────── $this->start_controls_section( 'hours_style', array( 'label' => __( 'Hours', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => array( 'show_hours' => 'yes' ), ) ); $this->add_control( 'hours_day_color', array( 'label' => __( 'Day Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-hours-day' => 'color: {{VALUE}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'hours_day_typography', 'label' => __( 'Day Typography', 'a1-tools' ), 'selector' => '{{WRAPPER}} .a1tools-hours-day', ) ); $this->add_control( 'hours_time_color', array( 'label' => __( 'Time Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-hours-time' => 'color: {{VALUE}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array( 'name' => 'hours_time_typography', 'label' => __( 'Time Typography', 'a1-tools' ), 'selector' => '{{WRAPPER}} .a1tools-hours-time', ) ); $this->add_control( 'hours_closed_color', array( 'label' => __( 'Closed Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-hours-closed .a1tools-hours-time' => 'color: {{VALUE}};' ), ) ); $this->add_control( 'hours_day_width', array( 'label' => __( 'Day Column Width', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 60, 'max' => 200, 'step' => 5 ) ), 'default' => array( 'unit' => 'px', 'size' => 110 ), 'separator' => 'before', 'selectors' => array( '{{WRAPPER}} .a1tools-hours-day' => 'min-width: {{SIZE}}{{UNIT}};' ), ) ); $this->end_controls_section(); // ── Style: Layout ─────────────────────────────────────────── $this->start_controls_section( 'layout_style', array( 'label' => __( 'Layout', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_control( 'item_spacing', array( 'label' => __( 'Item Spacing', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => array( 'px' ), 'range' => array( 'px' => array( 'min' => 0, 'max' => 60 ) ), 'default' => array( 'unit' => 'px', 'size' => 20 ), 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-widget' => 'gap: {{SIZE}}{{UNIT}};', ), ) ); $this->add_control( 'show_item_divider', array( 'label' => __( 'Show Dividers', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', 'default' => '', ) ); $this->add_control( 'item_divider_color', array( 'label' => __( 'Divider Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#e0e0e0', 'condition' => array( 'show_item_divider' => 'yes' ), 'selectors' => array( '{{WRAPPER}} .a1tools-has-dividers > .a1tools-contact-info-item + .a1tools-contact-info-item' => 'border-top-color: {{VALUE}};', ), ) ); $this->end_controls_section(); // ── Style: Box ────────────────────────────────────────────── $this->start_controls_section( 'box_style', array( 'label' => __( 'Box Style', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_control( 'box_bg_color', array( 'label' => __( 'Background', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-widget' => 'background-color: {{VALUE}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), array( 'name' => 'box_border', 'selector' => '{{WRAPPER}} .a1tools-contact-info-widget', ) ); $this->add_control( 'box_border_hover_color', array( 'label' => __( 'Border Hover Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-widget:hover' => 'border-color: {{VALUE}};', ), 'condition' => array( 'box_border_border!' => '' ), ) ); $this->add_control( 'box_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-widget' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), ) ); $this->add_control( 'box_padding', array( 'label' => __( 'Padding', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', 'em' ), 'selectors' => array( '{{WRAPPER}} .a1tools-contact-info-widget' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ), ) ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), array( 'name' => 'box_shadow', 'selector' => '{{WRAPPER}} .a1tools-contact-info-widget', ) ); $this->end_controls_section(); } // ──────────────────────────────────────────────────────────────── // Render // ──────────────────────────────────────────────────────────────── protected function render() { $settings = $this->get_settings_for_display(); $vars = $this->get_site_vars(); $has_dividers = 'yes' === ( $settings['show_item_divider'] ?? '' ) ? ' a1tools-has-dividers' : ''; $underline = $settings['link_underline'] ?? 'none'; $underline_class = 'hover' === $underline ? ' a1tools-underline-hover' : ''; echo '
'; } private function render_info_item( $icon, $title, $value, $link_url, $underline_class = '' ) { if ( $link_url ) { echo ''; } else { echo '