get_item_count();
foreach( $order->get_items() as $item_id => $item ) {
//$product = apply_filters( ‘woocommerce_order_item_product’, $order->get_product_from_item( $item ), $item );
$product = $item->get_product();
if($product !== false)
{
$product_name = $product->get_title();
if($product->get_type()==”variation”){
$product = new WC_Product($product->get_parent_id());
}
if(get_post_meta($product->get_id(), ‘is_streaming_video’, true)) {
$hss_video_id = get_post_meta($product->get_id(), ‘_woo_video_id’, true);
if(!in_array($hss_video_id,$videos)){
$is_visible = true;
$product_permalink = apply_filters( ‘woocommerce_order_item_permalink’, $is_visible ? $product->get_permalink( $item ) : ”, $item, $order );
echo “

“;
//echo apply_filters( ‘woocommerce_order_item_name’, $product_permalink ? sprintf( ‘%s‘, get_permalink( get_option(‘woocommerce_myaccount_page_id’)).”/view-video/?hss-video-id=”.$product->get_id(), $item[‘name’] ) : $item[‘name’], $item, $is_visible );
echo apply_filters( ‘woocommerce_order_item_name’, $product_permalink ? sprintf( ‘%s‘, get_permalink( get_option(‘woocommerce_myaccount_page_id’)).”/view-video/?hss-video-id=”.$product->get_id(), $product_name ) : $product_name, $item, $is_visible );
echo “

“;
array_push($videos,$hss_video_id);
}
}elseif(get_post_meta($product->get_id(), ‘is_streaming_video_bundle’, true)) {
$hss_group_id = get_post_meta($product->get_id(), ‘_hss_woo_group_id’, true);
if(!in_array($hss_group_id,$videos)){
$is_visible = true;
$product_permalink = apply_filters( ‘woocommerce_order_item_permalink’, $is_visible ? $product->get_permalink( $item ) : ”, $item, $order );
echo “

“;
//echo apply_filters( ‘woocommerce_order_item_name’, $product_permalink ? sprintf( ‘%s‘, get_permalink( get_option(‘woocommerce_myaccount_page_id’)).”/view-video/?hss-video-id=”.$product->get_id(), $item[‘name’] ) : $item[‘name’], $item, $is_visible );
echo apply_filters( ‘woocommerce_order_item_name’, $product_permalink ? sprintf( ‘%s‘, get_permalink( get_option(‘woocommerce_myaccount_page_id’)).”/view-video/?hss-video-id=”.$product->get_id(), $product_name ) : $product_name, $item, $is_visible );
echo “

“;
array_push($videos,$hss_group_id);
}
}
}
}

?>