Home Forums WoodMart support forum error size guide

error size guide

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #317639

    camilo517
    Participant

    There is an error with the size guide If you assign a size guide to a category, but the product has two categories assigned, the size guide will not be displayed. It should be shown since that size guide is assigned to that category and that product has that category assigned even if there is another

    #317654

    Artem Temos
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    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[0] != 'none' ){
            $sguide_post_id = $sguide_post_id[0];
        }else{
            $terms = wp_get_post_terms( $post_id, 'product_cat' );
            if ( $terms ) {
                foreach( $terms as $term ){
                if ( get_term_meta( $term->term_id, 'woodmart_chosen_sguide', true ) ) {
                        $sguide_post_id = get_term_meta( $term->term_id, 'woodmart_chosen_sguide', true );
                    }
                }
            }
        }
    
        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 );
        }
    }

    Kind Regards

    #317679

    camilo517
    Participant

    fails
    The code snippet has been disabled due to an error on line 2:

    Unable to redeclare the woodmart_sguide_display function.

    #317690

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #318025

    camilo517
    Participant

    It is a web in production
    It does not allow to redeclare the function
    Can you add this as an option within the theme settings?

    #318076

    Artem Temos
    Keymaster

    Yes, this bug will be fixed in our next theme update as well.

    #318151

    camilo517
    Participant

    Estimated date? Thanks

    #318347

    Artem Temos
    Keymaster

    We hope to release the update next month.

Viewing 8 posts - 1 through 8 (of 8 total)