Addons

WhatsApp Contact Button

Adds a floating WhatsApp launcher so shoppers can message your sales or support team without leaving the storefront.

Behavior overview

  • WhatsappIntegrationAddon enqueues CSS/JS on wp_enqueue_scripts and prints the floating button in wp_footer.
  • Assets live under app/Addons/whatsapp_integration/assets/ (SVG icon, styles, lightweight script).
  • Addon aborts if no phone number is configured or if it’s running in wp-admin.
  • Context detection (product/cart/checkout/other) controls whether the button appears, based on the display_context setting.

Settings reference

Field Key Description
WhatsApp Number phone_number Digits only (country code + number). Required or nothing renders.
Greeting Template message_template Default: “Hi! I'm interested in {product}…”. Supports placeholders {product}, {price}, {url}, {site}.
Display Context display_context Options: storefront (default), product_only, cart_checkout, all.
Button Position button_position Bottom right (default) or bottom left.
Accent Color accent_color HEX color validated via sanitize_hex_color(). Defaults to WhatsApp green (#25d366).

Implementation checklist

  1. Enable the addon in Kitbix Commerce → Addons.
  2. Enter your phone number using digits only (no + signs or spaces).
  3. Customize the greeting template with localized copy; keep placeholders intact for dynamic substitution.
  4. Pick where the button should appear (position + display context).
  5. Open a storefront page and click the button to ensure it launches the correct https://wa.me/ link with prefilled message.
Tip: If your support hours vary, update the template to mention response windows.

Troubleshooting

  • No button? Confirm the addon is enabled and that the phone number passes the regex (digits only).
  • Context mismatch? Review display_context; the addon short-circuits on pages without Kitbix shortcodes unless you choose “all”.
  • Color not changing? Ensure you’re supplying a valid HEX value (#RRGGBB). Invalid values fall back to the default green.
Reminder: The floating button is injected via wp_footer. Themes that omit wp_footer() will never render the addon—fix the theme first.