Noptin_WooCommerce::get_order_item_details( WC_Order_Item_Product $item )

Returns an array of order item details.


Parameters Parameters

$item

(WC_Order_Item_Product) (Required) The item id.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/integrations/class-noptin-woocommerce.php

	protected function get_order_item_details( $item ) {

		$product_id   = $item->get_product_id();
        $variation_id = $item->get_variation_id();

        if ( empty( $variation_id ) ) {
            $variation_id = $item->get_product_id();
		}

		return array(
			'item_id'      => $item->get_id(),
			'product_id'   => $product_id,
			'variation_id' => $variation_id,
			'name'         => $item->get_name(),
			'price'        => $item->get_total(),
			'quantity'     => $item->get_quantity(),
		);

	}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.3.0Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation