Home Forums WoodMart support forum Size Guide disappeared! Reply To: Size Guide disappeared!

#117201

Hello,

We shall fix this in our nearest update. Meanwhile please add this code to the functions.php of the child theme and activate your plugins:

    function woodmart_sguide_display( $post_id = false ){
        $post_id = ( $post_id ) ? $post_id : get_the_ID();
        
        $sguide_post_id = get_post_meta( $post_id, 'woodmart_sguide_select' );
        
        if ( isset( $sguide_post_id[0] ) && $sguide_post_id[0] == 'disable' ) return; 
        
        if ( isset( $sguide_post_id[0] ) && !empty( $sguide_post_id[0] ) ){
            $sguide_post_id = $sguide_post_id[0];
        }else{
            $terms = wp_get_post_terms( $post_id, 'product_cat' );
            if ( $terms ) {
                foreach( $terms as $term ){
					$sguide_post_meta = get_term_meta( $term->term_id, 'woodmart_chosen_sguide' );
                    if ( $sguide_post_meta[0] ) {
                        $sguide_post_id = $sguide_post_meta[0];
                    }else{
                        $sguide_post_id = false;
                    }
                }
            }
        }    
        if ( $sguide_post_id ) {
            $sguide_post = get_post( $sguide_post_id );
            $size_tables = get_post_meta( $sguide_post_id, 'woodmart_sguide' );
                
            woodmart_sguide_display_table_template( $sguide_post, $size_tables );
        }
    }

Best Regards