Helper; if ( $Helper->is_hidden( $data ) || ! $Helper->admin_view( $data ) ) { return ''; } $label = $data['label'] ?? 'Business Hour'; $name = '_businesshour'; $value = ! empty( get_post_meta( $post_id, 'adqs_business_data', true ) ) ? get_post_meta( $post_id, 'adqs_business_data', true ) : []; $daysOfWeek = [ 'sunday' => 'Sunday', 'monday' => 'Monday', 'tuesday' => 'Tuesday', 'wednesday' => 'Wednesday', 'thursday' => 'Thursday', 'friday' => 'Friday', 'saturday' => 'Saturday', ]; // Check pricing restrictions for both creating and editing if ( $ispricing ) { // Get order ID: from post meta when editing, from URL when creating. if ( isset( $_GET['postid'] ) ) { $order_id = get_post_meta( absint( $_GET['postid'] ), 'adqs_pricing_order_no', true ); } else { $order_id = $_GET['adqs_order'] ?? 0; } $order_id = absint( $order_id ); if ( $order_id > 0 ) { if ( $pricing_active === 'self' ) { if ( ! function_exists( 'adp_get_query_order' ) || ! function_exists( 'adp_get_query_pricing_meta' ) ) { return; } $pricing = adp_get_query_order( $order_id, 'pricing_id' ); $pricing_id = isset( $pricing->pricing_id ) ? $pricing->pricing_id : 0; $exist_field = $pricing_id ? adp_get_query_pricing_meta( $pricing_id, 'lm' . $name, true ) : 'no'; if ( $exist_field !== 'yes' ) { return; } } elseif ( $pricing_active === 'wc' ) { $pricing = function_exists( 'adp_wc_get_query_order' ) ? adp_wc_get_query_order( $order_id ) : null; $product_id = $pricing->pricing_id ?? 0; $exist_field = function_exists( 'adp_wc_get_meta' ) && $product_id ? adp_wc_get_meta( $product_id, 'lm' . $name ) : 'no'; if ( $exist_field !== 'yes' ) { return; } } } } ?>