How to Add an "Order on WhatsApp" Button to WooCommerce (2026)

WooCommerce 30 Aug 2026 9 min read
Quick answer

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.

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:

It works against you when:

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.

PlacementWhat the pre-filled message should containWhat it's good for
Product page, after Add to CartProduct name, price, product URLEnquiries on high-ticket or custom items
Shop / category loopProduct name and URL onlyQuick "is this available?" traffic
Cart pageEvery line item, quantity, cart totalBuyers who stalled before payment
Checkout, as a fallbackCart contents plus "need help paying"Rescuing failed payments and COD hesitation
Thank-you (order received) pageOrder number and totalPost-purchase questions, address fixes
Floating site-wide widgetNothing, or the current page URLGeneral 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.

  1. Get your number in the right format. International format, digits only, no +, no spaces, no dashes. An Indian number becomes 919876543210. Replace the placeholder in both snippets.
  2. Add the product-page button. This hooks woocommerce_after_add_to_cart_button and builds a wa.me link 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' )
	);
}
  1. 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' )
	);
}
  1. 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.
  2. Escape everything you print. esc_url() on the href, esc_html__() on the label.
  3. Test on a real phone. Desktop wa.me links open WhatsApp Web and behave differently. Check Android and iOS.
  4. 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:

What the button cannot do

The button is customer-initiated, one-way and stateless. It cannot:

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.

MessageCategoryWhen it sendsPurpose
Order confirmationUtilityPayment or order placedKills "did it go through?" tickets
COD confirm-or-cancelUtilityBefore dispatchCuts fake orders and RTO
Shipped + trackingUtilityFulfilmentFewer "where is my order" messages
Abandoned cart nudgeMarketing1–4 hours after drop-offRecovers 15–30% vs 2–5% by email
Review requestMarketing2–3 days after delivery3–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/).

Frequently asked questions

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.

Start free now — and unlock up to 6 months free total

Start free for 30 days. Join through a referral link for 1 free Launch month, then earn 5 more free months by referring five businesses that connect WhatsApp.

Start free →
Chat with us