• Resolved 76tagztech

    (@76tagztech)


    i want to integrate sms api with woocommerce

    add_action(‘woocommerce_payment_complete’, ‘custom_process_order’, 10, 1);
    function custom_process_order($order_id) {
    //Lets get data about the order made
    $order = new WC_Order( $order_id );

    //Now will fetch customer/buyer id here
    $customer_id = $order->user_id;

    //now finally we fetch phone number
    $billing_phone = get_user_meta( $customer_id, ‘billing_phone’, true );

    // Now put your HTTP SMS API URL . I PUT WHICH WE ARE USING
    $jsonurl = “https://www.smsidea.co.in/smsstatuswithid.aspx?mobile=9227763361&pass=JUUHX
    &senderid=WRESKY&to=$billing_phone&msg=textmessage&method=post”;

    // NOW WILL CALL FUNCTION CURL
    $json = curl($jsonurl);

    return $order_id;

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘woocommerce sms api integration’ is closed to new replies.