roduct->get_upsell_ids() ) ), 'wc_products_array_filter_visible' ); $related_products = wc_products_array_orderby( $related_products, 'rand', 'desc' ); $related_product_ids = array_map( function( $product ) { return $product->get_id(); }, $related_products ); return $related_product_ids; } }