Shopify WhatsApp Button Generator

A floating WhatsApp button with a pre-filled message that includes the product and its link.

Describe the result you need. AI will set up the tool and ask for any missing details.

Configure with AI

Enter to submit · Shift + Enter for a new line

Sent to AI. Leave out passwords and private customer data.

Your details

Number and message

[product], [url] and [price] are replaced automatically on product pages.

Business hours
Scope

Your snippet file (snippets/whatsapp-button.liquid)

whatsapp-button.liquid
{%- comment -%}
  Floating WhatsApp button with a pre-filled message. [product], [url] and [price] fill in from the current product.
{%- endcomment -%}
{%- style -%}
  .ea-wa{position:fixed;right:1.25rem;bottom:1.25rem;z-index:30;width:56px;height:56px;border-radius:50%;background:#25D366;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px rgba(0,0,0,.25);text-decoration:none}
  .ea-wa[hidden]{display:none}
  .ea-wa svg{width:30px;height:30px;fill:#fff}
{%- endstyle -%}
{%- liquid
  assign wa_message = "Hi! Im interested in [product] ([url])"
  assign product_full_url = shop.url | append: product.url
  if product
    assign wa_message = wa_message | replace: '[product]', product.title | replace: '[url]', product_full_url
    assign price_str = product.price | money
    assign wa_message = wa_message | replace: '[price]', price_str
  else
    assign wa_message = wa_message | replace: '[product]', shop.name | replace: '[url]', shop.url | replace: '[price]', ''
  endif
-%}
{%- if true -%}
<a
  id="ea-whatsapp-btn"
  class="ea-wa"
  href="https://wa.me/15551234567?text={{ wa_message | url_encode }}"
  target="_blank"
  rel="noopener"
  aria-label="Chat on WhatsApp"
  
>
  <svg viewBox="0 0 32 32" aria-hidden="true"><path d="M16 2C8.3 2 2 8.3 2 16c0 2.6.7 5.1 2 7.3L2 30l6.9-1.8c2.1 1.2 4.5 1.8 7.1 1.8 7.7 0 14-6.3 14-14S23.7 2 16 2zm7.6 20c-.3.9-1.7 1.6-2.6 1.8-.7.1-1.6.2-4.7-1-3.9-1.6-6.5-5.4-6.7-5.7-.2-.3-1.6-2.1-1.6-4s1-2.8 1.4-3.2c.4-.4.8-.5 1.1-.5h.8c.3 0 .6 0 .9.7.3.8 1.1 2.7 1.2 2.9.1.2.2.5 0 .8-.1.3-.2.5-.4.7-.2.3-.4.5-.6.7-.2.2-.4.4-.2.8.2.4 1 1.7 2.2 2.7 1.5 1.3 2.7 1.7 3.1 1.9.4.2.6.1.9-.1.3-.3 1.1-1.2 1.4-1.6.3-.4.5-.3.9-.2.4.2 2.3 1.1 2.7 1.3.4.2.6.3.7.4.1.2.1.9-.2 1.7z"/></svg>
</a>

{%- endif -%}

To install: in Shopify admin go to Online Store → Themes, click … next to your theme → Edit code. Under Snippets choose Add a new snippet, name it as shown above, paste this code and save. Add {% render 'whatsapp-button' %} to theme.liquid just before </body> so it appears on every page.

Live preview

wa.me links, filled in automatically

WhatsApp's wa.me/PHONE?text=MESSAGE links open a chat with your number and a pre-typed message, no account or app on your side needed. This snippet fills in [product], [url] and [price] placeholders from the actual product on the page it's shown on, so every product gets its own accurate message.

Turn on business hours to hide the button, or swap in an "we're offline" message, outside the days and times you set, checked in your own timezone in the shopper's browser.

Adding it to your theme

  1. 01

    Enter your number

    Use your full WhatsApp Business number in international format, digits only (for example 15551234567 for a US number, no +, spaces or leading 00).

  2. 02

    Add the snippet

    Online Store → Themes → Edit code → Snippets → Add a new snippet named whatsapp-button, paste the code, then add {% render 'whatsapp-button' %} to theme.liquid just before </body> so it appears on every page.

Questions people ask

Do I need the WhatsApp Business API for this?

No, this works with a free WhatsApp Business (or even a regular WhatsApp) account, since it's just a link that opens a chat.

What happens on pages that aren't a product page?

The [product] and [url] placeholders fall back to your store's name and homepage, so the message still makes sense.

Can I show it only on product pages?

Yes, turn on Only show on product pages.

Does this track clicks?

No. Add your own click-tracking (for example a GA4 event) if you need that; this snippet only builds the link.

Want this builtinto your store?

I'm Emmanuel, a Shopify and WooCommerce developer. If this tool pointed at something you'd rather have fixed for you (a faster store, cleaner product data, a migration, a custom feature), send me a note.

Emmanuel Asika

Emmanuel Asika

Shopify & WooCommerce developer, Dublin

I build and fix online stores: new builds, migrations, speed, SEO and the custom bits apps can't do.

hello@emmanuelasika.com

Last reviewed 30 September 2026.