Skip to content

Instantly share code, notes, and snippets.

@stukennedy
Created October 12, 2016 18:21
Show Gist options
  • Save stukennedy/764460ff19bb43270d6d6411ca156786 to your computer and use it in GitHub Desktop.
Save stukennedy/764460ff19bb43270d6d6411ca156786 to your computer and use it in GitHub Desktop.
WooCommerce Continuata Integration
<?php
include('continuata.php');
$continuata = new Continuata(COMPANY_ID, COMPANY_PASSWORD);
$email = $order->billing_email;
$name = $order->billing_first_name.' '.$order->billing_last_name;
$price = $order->get_total();
$items = $order->get_items();
$num_items = count($items);
foreach ( $items as $line_item_data ) {
$product = $order->get_product_from_item( $line_item_data );
$item_price = $price/$num_items;
$sku = $product ? $product->get_sku() : '';
$continuata->addPurchase($name, $email, $sku, $item_price);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment