Created
October 12, 2016 18:21
-
-
Save stukennedy/764460ff19bb43270d6d6411ca156786 to your computer and use it in GitHub Desktop.
WooCommerce Continuata Integration
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 | |
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