View woocommerce-swellenterprise-sample.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Add to plugin or themes functions.php file | |
//Swell System add order | |
add_action( 'woocommerce_order_status_completed', 'wc_send_order_to_swell'); | |
function wc_send_order_to_swell( $order_id ) { | |
$order = wc_get_order($order_id); | |
$order_data = $order->get_data(); | |
$apiurl = 'https://app.swellsystem.com/api/clients'; | |
$token = ''; //add token here |