We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

I want to open the Shopify inbox chat box when the user clicks the contact us button .

I want to open the Shopify inbox chat box when the user clicks the contact us button .

samthk
Tourist
12 0 2

I have a contact us button on my website that needs to open the Shopify inbox chat box when the user clicks the button. Is it possible to do this ?

Replies 9 (9)

Noman01
Shopify Partner
7 0 4

By Clicking Open Shopify Inbox Chat

<a class="site-nav__link site-nav__link--icon" href="{{ request.path | append: "/?chat" }}" > Open Chat Box</a>

Regards
Muhammad Noman

gobrandbrite
Tourist
7 1 3

Did you figure out how to do this? Thanks!

Noman01
Shopify Partner
7 0 4

<a class="site-nav__link site-nav__link--icon" href="{{ request.path | append: "/?show_chat" }}" > Open Chat Box</a>

Try this it will work because Shopify inbox updates its handle form /?chat to /?show_chat.

Regards
Muhammad Noman
DuraPaw
Shopify Partner
17 0 10

Unfortunately, it did not work for us.

Noman01
Shopify Partner
7 0 4

<a class="site-nav__link site-nav__link--icon" href="{{ request.path | append: "/?chat" }}" > Open Chat Box</a>

Try this it will work because Shopify inbox updates its handle form  /?show_chat to /?chat.

Regards
Muhammad Noman
DuraPaw
Shopify Partner
17 0 10

Hi Noman01, what this link does is refresh the page and then open the chat box. Is there a way to prevent the refresh and simply just open the chat box?

 

Thank you for taking the time to respond and help.

Noman01
Shopify Partner
7 0 4

Hi, @samthk  

yes you can use the following code : <a href="/?chat"> Contact US </a>

or you can add /?chat this to your link in the navigation. 

Regards
Muhammad Noman
greenvalleycode
Explorer
48 0 8

Hi Muhammed, this is a great solution! It works, but instead of simply opening up the chat window, this link bounces the user to the homepage and then opens the chat window. Do you know how to open the chat window without redirecting or refreshing the page?

Noman01
Shopify Partner
7 0 4

@greenvalleycode  <a class="site-nav__link site-nav__link--icon" href="#" onclick="openChatBox(event)">Open Chat Box</a>

<script>
function openChatBox(event) {
event.preventDefault(); // Prevent the default link behavior
// Logic to open your chat box goes here, for example:
// document.querySelector('.chat-box').style.display = 'block';

// Update the URL without refreshing the page
const currentPath = window.location.pathname;
history.pushState(null, null, `${currentPath}/?chat`);
}
</script> try this

Regards
Muhammad Noman