diff --git a/integrations/ecommerce/woocommerce.php b/integrations/ecommerce/woocommerce.php index 52ffcdb..e9ad863 100644 --- a/integrations/ecommerce/woocommerce.php +++ b/integrations/ecommerce/woocommerce.php @@ -293,12 +293,12 @@ public function completed_order() { foreach ( $items as $item ) { $_product = $order->get_product_from_item( $item ); $product = array( - 'id' => $item->product_id, + 'id' => $item['product_id'], 'sku' => $_product->get_sku(), 'name' => $item['name'], 'price' => $item['line_subtotal'], 'quantity' => $item['qty'], - 'category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $item->product_id, 'product_cat' ), 'name' ) ), + 'category' => implode( ', ', wp_list_pluck( wc_get_product_terms( $item['product_id'], 'product_cat' ), 'name' ) ), ); $products[] = $product; @@ -336,4 +336,4 @@ function segment_commerce_woo() { return $commerce->init(); } -add_action( 'plugins_loaded', 'segment_commerce_woo', 100 ); \ No newline at end of file +add_action( 'plugins_loaded', 'segment_commerce_woo', 100 );