Arkadaşlar selam,
WooCommerce kullananların çoğu yeni siparişleri anında öğrenmek istiyor. Normalde bunun için ücretli eklentiler veya Meta Business API gibi uğraştırıcı çözümler var. Ben de biraz araştırıp tamamen ücretsiz ve basit bir yol buldum. Burada detaylıca paylaşayım, isteyen direkt uygulasın. 🚀
Mantık

Benim kullandığım yöntem CallMeBot adlı ücretsiz bir servis üzerinden çalışıyor.
  • +34 694 23 67 31 numarasını rehberinize kaydediyorsunuz sonra bu numaraya ''I allow callmebot to send me messages'' mesajını gönderiyorsunuz tırnaklar olmadan. sonra size api detaylarınızı mesaj olarak veriyor.
  • WooCommerce tarafında ise küçük bir kod parçası ekleyerek bu API’ye istek gönderiyoruz.
  • Böylece müşteri sepete ürün ekleyince ve sipariş tamamlanınca WhatsApp’ınıza otomatik mesaj geliyor.
Yani hem sepet hareketlerini hem de siparişleri anlık görebiliyorsunuz.
Adımlar

1. CallMeBot API Key Al

  1. https://www.callmebot.com/ adresine gir.
  2. Telefonunu kaydettir → WhatsApp üzerinden sana bir API Key gönderiyor.
  3. Örnek: apikey=8511403

2. WordPress’e Kod Ekle


WordPress admin panelinden:
Görünüm → Tema Dosya Düzenleyici → functions.php dosyasına aşağıdaki kodu ekle:


// 🛒 Sepete ürün eklenince WhatsApp bildirimi
add_action('woocommerce_add_to_cart', 'send_whatsapp_cart_notice', 10, 6);
function send_whatsapp_cart_notice($cart_item_key, $product_id, $quantity, $variation_id, $variation, $cart_item_data) {
    $product = wc_get_product($product_id);
    $msg = "🛒 Sepete Eklendi: " . $product->get_name() . " (x" . $quantity . ")";

    $phone = "burayanumara"; // Kendi numaran
    $apikey = "burayaapi"; // CallMeBot API Key

    $url = "https://api.callmebot.com/whatsapp.php?phone={$phone}&text=" . urlencode($msg) . "&apikey={$apikey}";
    wp_remote_get($url);
}

// 📦 Sipariş tamamlanınca WhatsApp bildirimi
add_action('woocommerce_thankyou', 'send_whatsapp_order_notice', 10, 1);
function send_whatsapp_order_notice($order_id) {
    if (!$order_id) return;

    $order = wc_get_order($order_id);
    $msg = "📦 Yeni Sipariş #" . $order->get_id() .
           " - " . $order->get_formatted_order_total() .
           " - " . $order->get_billing_first_name() . " " . $order->get_billing_last_name();

    $phone = "908508402798"; // Kendi numaran
    $apikey = "8511403"; // CallMeBot API Key

    $url = "https://api.callmebot.com/whatsapp.php?phone={$phone}&text=" . urlencode($msg) . "&apikey={$apikey}";
    wp_remote_get($url);
}
Ne Oluyor?
  • Müşteri sepete ürün eklediğinde WhatsApp’ına şu tarz mesaj düşer:

    🛒 Sepete Eklendi: iPhone 15 (x1)
  • Müşteri sipariş tamamladığında WhatsApp’ına şu mesaj düşer:

    📦 Yeni Sipariş #1234 - 1.250₺ - Ahmet Yılmaz