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.
Return Return
(array)
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() ) ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |