woocommerce sms api integration
-
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;
- The topic ‘woocommerce sms api integration’ is closed to new replies.