Platform Integration

WooCommerce Integration

Supercharge your WooCommerce store with AI-powered customer support. N8.Chat seamlessly integrates with WooCommerce to provide context-aware assistance.

Setup Requirements

Prerequisites

  • WordPress 5.8 or higher
  • WooCommerce 6.0 or higher
  • N8.Chat WordPress plugin installed and activated
  • n8n webhook configured (see n8n Setup Guide)
  • WooCommerce REST API keys (for order lookups)

Quick Setup Steps

  1. 1

    Install N8.Chat Plugin

    Download from WordPress.org or upload via Plugins > Add New

  2. 2

    Enable WooCommerce Integration

    Go to N8.Chat Settings > Integrations > Enable WooCommerce

  3. 3

    Configure Context Tags

    Select which WooCommerce data to include in chat context

  4. 4

    Set Up Order Lookup (Optional)

    Add WooCommerce API keys in n8n for real-time order queries

Cart Integration

N8.Chat automatically detects and includes cart data in every chat message, enabling powerful cart-aware conversations.

Available Cart Data

  • +Cart total (formatted and raw)
  • +Number of items
  • +Full cart contents (products, quantities, prices)
  • +Applied coupons
  • +Shipping methods available

Cart Recovery Features

  • -Detect abandoned carts
  • -Proactive checkout assistance
  • -Coupon suggestions
  • -Shipping cost clarification
  • -Payment method help

Cart Data in Webhook Payload:

{
  "message": "Can you help me with checkout?",
  "context": {
    "cart_total": "$249.99",
    "cart_total_raw": 249.99,
    "cart_items": 3,
    "cart_currency": "USD",
    "cart_contents": [
      {
        "product_id": 123,
        "name": "Premium Headphones",
        "quantity": 1,
        "price": 89.99,
        "sku": "HP-001"
      },
      {
        "product_id": 456,
        "name": "Wireless Charger",
        "quantity": 2,
        "price": 80.00,
        "sku": "WC-002"
      }
    ],
    "cart_coupons": ["SAVE10"],
    "cart_needs_shipping": true
  }
}

Order Tracking

Enable customers to check their order status directly through the chat widget using WooCommerce REST API integration.

Setting Up Order Lookup

  1. 1.

    Generate WooCommerce API Keys

    Go to WooCommerce > Settings > Advanced > REST API > Add Key

  2. 2.

    Set Permissions to Read

    For security, only grant read access for order lookups

  3. 3.

    Add Credentials to n8n

    Create WooCommerce credentials in n8n with your Consumer Key and Secret

n8n Workflow - Order Lookup:

// HTTP Request Node Configuration
{
  "method": "GET",
  "url": "https://yourstore.com/wp-json/wc/v3/orders",
  "authentication": "predefinedCredentialType",
  "nodeCredentialType": "wooCommerceApi",
  "queryParameters": {
    "customer": "={{ $json.context.user_email }}",
    "per_page": 5,
    "orderby": "date",
    "order": "desc"
  }
}

// Response includes:
// - Order ID, status, total
// - Line items
// - Shipping tracking (if available)
// - Estimated delivery date

Tip: Include order status translations in your AI prompt so it can explain statuses like "processing," "on-hold," or "completed" in customer-friendly language.

Product Recommendations

Leverage product context to provide intelligent recommendations and upsells.

Page-Based Recommendations

When a customer is viewing a product, recommend complementary items:

  • - Cross-sell related products
  • - Upsell premium alternatives
  • - Suggest frequently bought together

Cart-Based Recommendations

Analyze cart contents to suggest additions:

  • - Complete the look/set
  • - Add accessories
  • - Reach free shipping threshold

AI Prompt for Recommendations:

You are a helpful shopping assistant for our electronics store.

Current context:
- Customer is viewing: {{product_name}} ({{product_price}})
- Product category: {{product_category}}
- Cart total: {{cart_total}} ({{cart_items}} items)

Guidelines for recommendations:
1. If cart is below $50, suggest items to reach free shipping ($50+)
2. For headphones, recommend cases or cables
3. For phones, suggest screen protectors or chargers
4. Always mention current promotions if applicable

Be helpful but not pushy. Only recommend 2-3 items maximum.

Customer Data

Access customer information to provide personalized support for logged-in users.

Data PointContext TagUse Case
Customer Name{{user_name}}Personalized greetings
Email{{user_email}}Order lookups, account issues
Total Orders{{customer_orders_count}}Loyalty recognition
Total Spent{{customer_total_spent}}VIP treatment, special offers
Last Order{{order_id}}Quick order status

Privacy Note: Customer data is only available for logged-in users and is transmitted securely. Consider your privacy policy when enabling customer data features.

Real-World Use Cases

Cart Abandonment Recovery

Proactively engage customers who have items in their cart but haven not checked out.

Example Conversation:

AI: "Hi! I noticed you have 3 items in your cart totaling $129.99. Can I help you complete your purchase?"

Customer: "The shipping seems expensive"

AI: "I understand! You are only $20.01 away from free shipping. Would you like me to suggest some items to reach the threshold?"

Order Status Updates

Allow customers to check their order status without leaving the page.

Example Conversation:

Customer: "Where is my order?"

AI: "Hi John! Your most recent order #WC-12345 is currently being shipped. It left our warehouse yesterday and should arrive by Friday, January 17th. Would you like the tracking link?"

Product Questions

Answer questions about the product the customer is currently viewing.

Example Conversation:

Customer: "Is this compatible with iPhone?"

AI: "Great question! The Premium Headphones (HP-001) you are viewing are compatible with all iPhones via Bluetooth 5.0. They also work with any device that supports standard Bluetooth audio. Would you like to know about the battery life?"

Return and Refund Assistance

Help customers with return requests by looking up their order history.

Example Conversation:

Customer: "I want to return my last order"

AI: "I can help with that, John. Your order #WC-12345 from January 10th is still within our 30-day return window. I see you purchased Premium Headphones - may I ask why you would like to return them? This helps us improve."

Advanced Configuration

Selective Data Sharing

Control which WooCommerce data is sent with chat messages in the plugin settings:

Enable/Disable:

  • - Cart data
  • - Order history
  • - Product information
  • - Customer details

Privacy Options:

  • - Mask email addresses
  • - Hide order totals
  • - Anonymize customer IDs
  • - GDPR compliance mode

Page-Specific Behavior

Configure different AI behaviors based on which page the customer is viewing:

// n8n Switch Node - Route by page type
const pageUrl = $json.context.page_url;

if (pageUrl.includes('/product/')) {
  return 'product_assistant';
} else if (pageUrl.includes('/cart') || pageUrl.includes('/checkout')) {
  return 'checkout_assistant';
} else if (pageUrl.includes('/my-account/orders')) {
  return 'order_support';
} else {
  return 'general_support';
}

Best Practices

Keep Responses Fast

Use caching for product data and limit API calls to maintain quick response times

Personalize Thoughtfully

Use customer data to help, not to seem invasive. Focus on relevance.

Be Helpful, Not Pushy

Offer assistance and suggestions naturally without aggressive upselling

Handle Errors Gracefully

If order lookup fails, apologize and offer alternative help options