'product' ); $products = new WP_Query( $args ); $post_meta_record = array(); foreach ( $products->posts as $prod ){ $array = wc_get_product ( $prod ->ID ); if( !$array->is_in_stock () ){ $post_meta_record[] = $prod; } } if( isset( $post_meta_record ) ){ foreach ( $post_meta_record as $k=> $val ){ $status = 'Disabled'; $test_sts = get_post_meta( $val->ID, '_waitlist_button' ); if($test_sts[0] == 'yes'){ $status = 'Enabled'; $html = ''; }else{ $html = ''; } $detail[$k] = array( $val->post_title, $status, $html, $val->ID ); } function test_prod_waitlisted($get_waitlisted_product1, $det_val){ $id = get_post_meta($det_val, CED_AWL_PREFIX.'ced_waitlist_id',true); foreach ( $get_waitlisted_product1 as $kop => $vop ){ return ($id == $vop['ID']) ? 'yes': 'no'; } } function get_ID_prod_waitlisted($get_waitlisted_product1, $det_val){ foreach ( $get_waitlisted_product1 as $kop => $vop ){ if($vop['post_title'] == $det_val){ return $vop['ID']; }else{ return false; } } } ?>
| Product | Status | Edit | |
|---|---|---|---|
| Waitlisted | Not Waitlisted |