How to Add an "Order on WhatsApp" Button to WooCommerce (2026)
Plenty of WooCommerce stores lose the sale at the last step because the buyer has one unanswered question: will it ship to my pincode, is COD available, can I get a bulk rate? An "Order on WhatsApp" button moves that question into a chat where you can answer in seconds, and in 2026 it takes about twenty lines of PHP in a child theme — or one small button plugin if you would rather click than code. The Tech Pad picks up where a button stops: automatic order confirmations, shipping updates, COD checks and cart recovery sent from the same number on the official Meta WhatsApp Cloud API. Start free for 30 days, and if you join through a referral link you get 1 free Launch month, then 5 more free months by referring five businesses that connect WhatsApp — up to 6 months free total.
When an "Order on WhatsApp" button makes sense
A chat-first order path is not a universal upgrade. It wins when the purchase needs a human sentence before money moves:
- High-ticket items — furniture, machinery, jewellery, anything where a buyer wants reassurance before paying ₹40,000.
- Made-to-order and custom work — the spec is a conversation, not a variation dropdown.
- Wholesale and B2B — quantity-based pricing you do not want published.
- Unclear shipping — heavy goods, remote pincodes, cold chain, cross-border.
- New or low-trust stores — a reachable human is the cheapest trust signal you have.
- India COD — buyers who will not prepay but will happily confirm on WhatsApp.
It works against you when:
- You have a large catalogue and thousands of orders a month, so manual order entry becomes the bottleneck.
- Fulfilment is automated and pulls from WooCommerce order objects that a chat never creates.
- You need clean tax, GST and invoice records on every sale.
- You run paid traffic into a tuned checkout funnel and the button leaks buyers out of it.
Rule of thumb: keep normal checkout as the default, and use the button only where a question is genuinely blocking the order.
Where to put the button, and what the message should say
Placement decides whether the button helps or cannibalises checkout.
| Placement | What the pre-filled message should contain | What it's good for |
|---|---|---|
| Product page, after Add to Cart | Product name, price, product URL | Enquiries on high-ticket or custom items |
| Shop / category loop | Product name and URL only | Quick "is this available?" traffic |
| Cart page | Every line item, quantity, cart total | Buyers who stalled before payment |
| Checkout, as a fallback | Cart contents plus "need help paying" | Rescuing failed payments and COD hesitation |
| Thank-you (order received) page | Order number and total | Post-purchase questions, address fixes |
| Floating site-wide widget | Nothing, or the current page URL | General support, not ordering |
Floating widgets are the domain of tools like Joinchat, Click to Chat and Chaty. They do that job well and they are free or cheap. What none of them do is send a message on their own — they only open a chat the customer has to start. That distinction matters later in this post.
The code: two snippets for your child theme
Snippet edits belong in a child theme's functions.php or a code-snippets plugin. Never edit a parent theme; the next update erases your work. Take a backup and test on staging first.
- Get your number in the right format. International format, digits only, no
+, no spaces, no dashes. An Indian number becomes919876543210. Replace the placeholder in both snippets. - Add the product-page button. This hooks
woocommerce_after_add_to_cart_buttonand builds awa.melink from the product title, display price and permalink:
add_action( 'woocommerce_after_add_to_cart_button', 'ttp_wa_order_button', 20 );
function ttp_wa_order_button() {
global $product;
if ( ! $product instanceof WC_Product ) {
return;
}
$number = '919876543210'; // Digits only, no + and no spaces.
$price = html_entity_decode( wp_strip_all_tags( wc_price( wc_get_price_to_display( $product ) ) ) );
$message = "Hi, I'd like to order this item:\n";
$message .= $product->get_name() . "\n";
$message .= 'Price: ' . $price . "\n";
$message .= 'Link: ' . get_permalink( $product->get_id() );
$url = 'https://wa.me/' . $number . '?text=' . rawurlencode( $message );
printf(
'<a class="button ttp-wa-order" href="%s" target="_blank" rel="noopener nofollow">%s</a>',
esc_url( $url ),
esc_html__( 'Order on WhatsApp', 'ttp' )
);
}
- Add the cart-page button. This one loops
WC()->cart->get_cart()so the customer lands in chat with the whole basket already typed out:
add_action( 'woocommerce_after_cart_totals', 'ttp_wa_cart_button', 20 );
function ttp_wa_cart_button() {
if ( ! function_exists( 'WC' ) || ! WC()->cart || WC()->cart->is_empty() ) {
return;
}
$number = '919876543210';
$lines = array( "Hi, I'd like to order this cart:" );
foreach ( WC()->cart->get_cart() as $cart_item ) {
$product = isset( $cart_item['data'] ) ? $cart_item['data'] : null;
if ( ! $product instanceof WC_Product ) {
continue;
}
$lines[] = sprintf( '- %s x %d', $product->get_name(), (int) $cart_item['quantity'] );
}
$lines[] = 'Total: ' . html_entity_decode( wp_strip_all_tags( WC()->cart->get_total() ) );
$url = 'https://wa.me/' . $number . '?text=' . rawurlencode( implode( "\n", $lines ) );
printf(
'<p><a class="button ttp-wa-order" href="%s" target="_blank" rel="noopener nofollow">%s</a></p>',
esc_url( $url ),
esc_html__( 'Order this cart on WhatsApp', 'ttp' )
);
}
- Keep the message short.
rawurlencode()handles line breaks and symbols correctly, but very long pre-filled text gets truncated on some devices. Names, quantities and a total are enough. - Escape everything you print.
esc_url()on the href,esc_html__()on the label. - Test on a real phone. Desktop
wa.melinks open WhatsApp Web and behave differently. Check Android and iOS. - Style it as the secondary action. If the WhatsApp button outshines Add to Cart, prepaid orders will fall.
Turning those chats into recorded orders
A chat is not an order object, so decide up front how the record and the money get created:
- Manual order creation — WooCommerce → Orders → Add order, add the line items, then send a payment link. Slow but exact, and correct for GST and invoicing.
- Payment link back into checkout — reply with a cart or pre-built checkout URL. The customer pays through your usual gateway and WooCommerce records everything.
- Keep checkout as the default — answer the blocking question in chat, then send the buyer back to the product page. Nothing about your reporting changes.
- COD confirmation — take the order on the site, then confirm it on WhatsApp before dispatch. Detail in [COD confirmation on WhatsApp](/blog/cod-confirmation-whatsapp-cut-rto-fake-orders/).
What the button cannot do
The button is customer-initiated, one-way and stateless. It cannot:
- send an order confirmation when a payment succeeds;
- push processing, shipped and delivered updates with a tracking link;
- chase an abandoned cart an hour later;
- ask for COD confirmation across 300 orders a day;
- request a review after delivery.
Those are all business-initiated messages, which means the official WhatsApp Cloud API and Meta-approved templates. That is exactly what The Tech Pad's free WooCommerce connector handles: confirmed, processing, shipped and delivered notifications plus cart recovery, sent from the same number your button points at, with a shared team inbox at [/features/inbox/](/features/inbox/) for the replies. There is no monthly SaaS fee for the connectors — you pay Meta's per-message conversation fees (utility roughly ₹0.10–0.30 in India, marketing about 2–3× utility; check Meta's current rate card). See [/woocommerce/](/woocommerce/), the [plugin library](/plugins/), [/industries/woocommerce/](/industries/woocommerce/) and [order status notifications](/blog/woocommerce-order-status-notifications-whatsapp/).
Message templates to pair with the button
Any business-initiated message outside the 24-hour customer-service window needs an approved template, and category matters: order updates are utility, promotions are marketing.
| Message | Category | When it sends | Purpose |
|---|---|---|---|
| Order confirmation | Utility | Payment or order placed | Kills "did it go through?" tickets |
| COD confirm-or-cancel | Utility | Before dispatch | Cuts fake orders and RTO |
| Shipped + tracking | Utility | Fulfilment | Fewer "where is my order" messages |
| Abandoned cart nudge | Marketing | 1–4 hours after drop-off | Recovers 15–30% vs 2–5% by email |
| Review request | Marketing | 2–3 days after delivery | 3–5× the response of email |
"Hi {{1}}, your order {{2}} is confirmed. Total {{3}}, payment method {{4}}. We'll message you here the moment it ships. Reply to this chat if the address needs a change."
"Hi {{1}}, one quick confirmation before we dispatch order {{2}} (cash on delivery, {{3}}). Reply YES to confirm or NO to cancel — confirmed orders ship the same day."
Cart recovery copy is in [abandoned cart recovery templates](/blog/whatsapp-abandoned-cart-recovery-templates/). WhatsApp earns roughly a 98% open rate against about 20% for email, and median replies land under 90 seconds — keep templates answerable in one word.
FAQ
Can I add an Order on WhatsApp button without a plugin?
Yes. A small snippet hooked into WooCommerce's product or cart templates can build a wa.me link containing the product name, quantity and price. A plugin is only worth it if you want placement controls, per-product rules and analytics without editing code.
Will WhatsApp orders still be recorded in WooCommerce?
Not by themselves — a chat is not an order object. Either create the order manually from the conversation, or use the button for enquiries and high-ticket items while normal checkout stays the default path for recorded orders.
Can I pre-fill the customer's cart in the message?
Yes. Loop through the cart items on the cart or checkout page and build the message text with names, quantities and the total, then URL-encode it into the wa.me link. Keep it short — very long pre-filled text gets truncated on some devices.
Is this useful for cash-on-delivery orders in India?
Very. A WhatsApp confirmation step before dispatch is one of the cheapest ways to cut fake COD orders and return-to-origin shipments. Send an approved utility template asking the customer to confirm, and only ship once they reply.
Add the button, then automate the follow-up
The button opens the door; the API keeps the conversation going without anyone typing. Connect your store to the official Cloud API through The Tech Pad and order confirmations, COD checks, shipping updates, cart recovery and review requests all run from the number your customers already message. Start free for 30 days at [/wa/](/wa/) — join through a referral link for 1 free Launch month, then earn 5 more free months by referring five businesses that connect WhatsApp, up to 6 months free total. Plans are listed at [/pricing](/pricing), and the full connector walkthrough is at [/blog/whatsapp-woocommerce-integration-setup-templates/](/blog/whatsapp-woocommerce-integration-setup-templates/).