Add WhatsApp product enquiries to WooCommerce with AI
The WhatsApp chat on every product page opens with the product name filled in, plus an optional Ask button.
Prerequisites
A site connected to WPVibe running WooCommerce and the free Joinchat plugin (tested on 6.4.1) with a WhatsApp number set, and an administrator account.
My WooCommerce store uses the free Joinchat plugin for its WhatsApp chat. Set it up for product enquiries:
- Pre-filled message on product pages: "[Hi {SITE}, I have a question about {PRODUCT} ({SKU})]"
- [Optional] Chat bubble text on product pages: "[Questions about {PRODUCT}? Ask us here]"
- A button on each product page that says "[Ask about this on WhatsApp]", placed [after the short description] [or: no button]
1. Read the current values with run_wp_cli, one command each: option pluck joinchat telephone, then option pluck joinchat message_send_product, and the same for message_text_product, message_text_on_sale, woo_btn_position and woo_btn_text. If the joinchat option is not found or telephone is empty, stop and tell me to set my WhatsApp number in Joinchat first. A key that says no data exists has never been saved: treat it as empty. Keep the values for undo.
2. These settings apply to every product page at once and go live right away. Show me the current and new values and wait for my yes. If message_text_on_sale has a value, tell me: products on sale show that text instead of the product bubble text.
3. Set each value with run_wp_cli, one key per command, so nothing else in Joinchat's settings changes: option patch update joinchat [key] "[value]" for a key that has a value, option patch insert joinchat [key] "[value]" for a key that had no data. Never rewrite the whole joinchat option. Don't use run_ability for Joinchat's set-* abilities: they are not reachable over REST. Keys: message_send_product (pre-filled message; {PRODUCT}, {SKU}, {PRICE} and {SITE} fill in), message_text_product (bubble text), woo_btn_text (button label), and woo_btn_position, one of: woocommerce_single_product_summary__5 (after title), woocommerce_single_product_summary__10 (after price), woocommerce_single_product_summary__20 (after short description), woocommerce_single_product_summary__40 (after meta info), woocommerce_single_product_summary__50 (after share links), woocommerce_product_additional_information (after Additional information), woocommerce_before_add_to_cart_form, woocommerce_before_add_to_cart_button, woocommerce_after_add_to_cart_button, woocommerce_after_add_to_cart_form (the last four only on products with a price), or none for no button. Joinchat doesn't check values set this way, so copy them exactly.
4. Find a published product with no Joinchat settings of its own: rest_api GET /wp/v2/product?per_page=20 with fields id,link,meta, and pick one whose meta._joinchat is empty (products with their own settings keep them). Load its page with get_page_html and selector .joinchat: data-settings must show message_send with that product's name filled in. If it still shows the old values, clear the page cache and load it again. If I asked for a button, load the page with selector .joinchat__woo-btn and confirm my label is there. If it is missing, change nothing more and tell me: on a classic theme that doesn't declare WooCommerce support, WooCommerce draws the product inside the page content and Joinchat skips its button there, at any position; the floating chat still sends the product message. Offer to try woocommerce_after_add_to_cart_form or to set the button to none, and do either only on my yes.
5. Give me the product link to try on my phone, and tell me how to undo: set each key back to the value you kept (an empty string for a key that had no data, and none for woo_btn_position).
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Add WhatsApp product enquiries to WooCommerce with AI” recipe from the WPVibe cookbook on my connected site.
A shopper with a question about one product rarely emails. If a WhatsApp chat opens already saying which product they mean, they ask, and you answer without a round of “which one?” Joinchat can do that on every product page, with the product name, SKU and price filled in, plus an “Ask about this” button next to the product. The settings live on Joinchat’s WooCommerce tab.
Ask your AI assistant and it reads your current Joinchat settings, shows you what it will change, and waits for your yes. Then it sets only the product page fields, one at a time, so the rest of your Joinchat setup stays exactly as it is. It loads a product page to confirm the chat now names the product and the button is where you asked, and if the button is missing it asks before trying anything else.
Give it the message you want pre-filled, using {PRODUCT}, {SKU} and {PRICE} where the details belong, and say where the button goes, or that you don’t want one. This is store-wide: it goes live on every product page at once, though products with their own Joinchat settings keep them. If the button doesn’t appear, your theme is a classic theme that doesn’t declare WooCommerce support, so WooCommerce draws the product inside the page content and Joinchat skips its button there; the assistant tells you before changing anything else, and the chat still sends the product message.
Outcome
Every product page offers a WhatsApp chat that already names the product, with a button beside the product if you asked for one.