• Tutorial
  • How to Add a Direct WhatsApp Link in a Contact Form for Real Estate Agents

To add a direct WhatsApp link to your contact form, locate the HTML or PHP file where your form is defined. Look for the code handling the contact information or the button you want to link. Replace or enhance it with the WhatsApp API link, ensuring you dynamically include the agent’s phone number and a pre-filled message. Save the changes and refresh your website to test the integration.

in: platform\themes\homzen\views\real-estate\agent.blade.php
Search for <div class=“agent-contact-info”>

Add example:

   <div class="agent-contact-info">
        @if($account->phone && ! setting('real_estate_hide_agency_phone', false))
            <a href="https://wa.me/{{ preg_replace('/\D/', '', $account->phone) }}?text=Olá, {{ $account->name }}. Gostaria de saber mais sobre algumas das propriedades a venda/aluguel." class="agent-info-item" target="_blank">
                <x-core::icon name="ti ti-phone" />
                {{ $account->phone }}
            </a>

in: platform\themes\homzen\views\real-estate\project.blade.php
<div class=“info line-clamp-1”>

                                 <div class="info line-clamp-1">
                                        <div class="text-1 name">
                                            <a href="{{ $account->url }}">{{ $account->name }}</a>
                                        </div>
                                        @if ($account->phone && ! setting('real_estate_hide_agency_phone', false))
                                        <a href="https://wa.me/{{ preg_replace('/\D/', '', $account->phone) }}?text=Olá, {{ $account->name }}. Estou interessado(a) no projeto {{ $project->name }}. Pode me retornar com maiores informações?" class="info-item" target="_blank">
                                            {{ $account->phone }}
                                        </a>
                                         @elseif($hotline = theme_option('hotline'))
                                        <a href="https://wa.me/{{ preg_replace('/\D/', '', $hotline) }}?text=Olá, {{ $account->name }}. Estou interessado(a) no projeto {{ $project->name }}. Pode me retornar com maiores informações?" class="info-item" target="_blank">
                                            {{ $hotline }}
                                        </a>
                                        @endif
                                        @if ($account->email && ! setting('real_estate_hide_agency_email', false))
                                            <a href="mailto:{{ $account->email }}" class="info-item">{{ $account->email }}</a>
                                        @endif
                                    </div>

in: platform\themes\homzen\views\real-estate\single-layouts\partials\contact.blade.php
<div class=“info line-clamp-1”>

        <div class="info line-clamp-1">
            <div class="text-1 name">
                <a href="{{ $account->url }}">{{ $account->name }}</a>
            </div>
            @if ($account->phone && ! setting('real_estate_hide_agency_phone', false))
                <a href="https://wa.me/{{ preg_replace('/\D/', '', $account->phone) }}?text={{ urlencode('Olá, estou interessado na ' . $property->name . ', poderia me fornecer mais detalhes?') }}" class="info-item" target="_blank">{{ $account->phone }}</a> <!-- LINK PARA WHATSAPP -->
            @elseif($hotline = theme_option('hotline'))
                <a href="https://wa.me/{{ preg_replace('/\D/', '', $hotline) }}?text={{ urlencode('Olá, estou interessado na ' . $property->name . ', poderia me fornecer mais detalhes?') }}" class="info-item" target="_blank">{{ $hotline }}</a> <!-- LINK PARA WHATSAPP -->
            @endif
            @if ($account->email && ! setting('real_estate_hide_agency_email', false))
                <a href="mailto:{{ $account->email }}" class="info-item">{{ $account->email }}</a>
            @endif
        </div>

You can customize the message and variables to suit your needs. In these examples, the link can send a default message about the specific property in question, or simply connect directly to the agent, addressing them by name. This flexibility allows you to tailor the experience for both the client and the agent.

Enjoy.

Botble

Of course, below are the details.

platform\themes\homzen\views\real-estate\agent.blade.php
agent.blade.php

platform\themes\homzen\views\real-estate\project.blade.php
project.blade.php

platform\themes\homzen\views\real-estate\single-layouts\partials\contact.blade.php
contact.blade.php

    4 months later

    I can do this for you. You can reach me… but I think it’s too late. LOL