start_controls_section( 'content_section', array( 'label' => __( 'Content', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ) ); $this->add_control( 'map_height', array( 'label' => __( 'Map Height', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 200, 'max' => 800, ), ), 'default' => array( 'size' => 400, 'unit' => 'px', ), ) ); $this->add_control( 'show_search', array( 'label' => __( 'Show Search Bar', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => 'yes', ) ); $this->add_control( 'show_filters', array( 'label' => __( 'Show State Filter', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'a1-tools' ), 'label_off' => __( 'No', 'a1-tools' ), 'return_value' => 'yes', 'default' => 'yes', ) ); $this->end_controls_section(); // ── Style: Cards ──────────────────────────────────────────── $this->start_controls_section( 'style_cards_section', array( 'label' => __( 'Store Cards', 'a1-tools' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ) ); $this->add_control( 'card_bg_color', array( 'label' => __( 'Card Background', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => array( '{{WRAPPER}} .a1tools-sl-card' => 'background-color: {{VALUE}};', ), ) ); $this->add_control( 'card_text_color', array( 'label' => __( 'Text Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => array( '{{WRAPPER}} .a1tools-sl-card' => 'color: {{VALUE}};', '{{WRAPPER}} .a1tools-sl-card-name' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'card_accent_color', array( 'label' => __( 'Accent Color', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#0066cc', 'selectors' => array( '{{WRAPPER}} .a1tools-sl-card-links a' => 'color: {{VALUE}};', '{{WRAPPER}} .a1tools-sl-card-phone a' => 'color: {{VALUE}};', '{{WRAPPER}} .a1tools-sl-card-email a' => 'color: {{VALUE}};', ), ) ); $this->add_control( 'card_border_radius', array( 'label' => __( 'Border Radius', 'a1-tools' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => array( 'px' => array( 'min' => 0, 'max' => 20, ), ), 'default' => array( 'size' => 8, 'unit' => 'px', ), 'selectors' => array( '{{WRAPPER}} .a1tools-sl-card' => 'border-radius: {{SIZE}}{{UNIT}};', ), ) ); $this->end_controls_section(); } // ──────────────────────────────────────────────────────────────── // Render // ──────────────────────────────────────────────────────────────── protected function render() { $settings = $this->get_settings_for_display(); echo a1tools_shortcode_store_locator( array( 'map_height' => $settings['map_height']['size'] ?? '400', 'show_search' => $settings['show_search'] ?? 'yes', 'show_filters' => $settings['show_filters'] ?? 'yes', ) ); } protected function content_template() { ?>
<# if ( settings.show_search === 'yes' || settings.show_filters === 'yes' ) { #>
<# if ( settings.show_search === 'yes' ) { #> <# } #> <# if ( settings.show_filters === 'yes' ) { #> <# } #>
<# } #>

Store Location 1

123 Main St, City, ST 12345

Store Location 2

456 Oak Ave, Town, ST 67890

Map loads on frontend