WC_Order_Item_Product_Data_Store::get_download_ids( WC_Order_Item_Product $item, WC_Order $order )

Get a list of download IDs for a specific item from an order.


Description Description


Parameters Parameters

$item

(Required) Product order item object.

$order

(Required) Order object.


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/data-stores/class-wc-order-item-product-data-store.php

	public function get_download_ids( $item, $order ) {
		global $wpdb;
		return $wpdb->get_col(
			$wpdb->prepare(
				"SELECT download_id FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE user_email = %s AND order_key = %s AND product_id = %d ORDER BY permission_id",
				$order->get_billing_email(),
				$order->get_order_key(),
				$item->get_variation_id() ? $item->get_variation_id() : $item->get_product_id()
			)
		);
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.