Home Forums Themes Support Frames Override the default header for WooCommerce, WooCommerce Shop.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13029
    jamisonc
    Supported

    Hello, I am looking at adding a shop to my website, and I would like to change the default header for my WooCommerce section only. I am adjusting the pages manually, and It lets me override the header for each WooCommerce Page (Account, Cart, Wishlist) but it will not let me change it for the SHOP page.

    I am wondering if there is something that I can do about this, or what might be causing this? Thank you.

    • This topic was modified 1 month, 2 weeks ago by jamisonc.
    #13035

    Hi,
    Thanks for contacting us and choosing our product!
    Because currently the Shop page use template from WooCommerce and it doesn’t use settings from Page Metabox.
    In this case you can resolve the issue by go to: wp-content/themes/frames/framework/includes/ then open file theme-functions.php
    then find this function haru_get_header_layout() on line 196 and change the code to this:

    if ( ! function_exists( 'haru_get_header_layout' ) ) {
        function haru_get_header_layout() {
            $haru_header_single = NULL;
    
            if ( is_page() || is_singular( array( 'post', 'product' ) ) ) {
                $haru_header_single = get_post_meta( get_the_ID(), 'haru_header', true );
            }
    
            if ( is_shop() || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
                $shop_page_id = get_option( 'woocommerce_shop_page_id' );
                $haru_header_single = get_post_meta( $shop_page_id, 'haru_header', true );
            }
    
            $haru_header = haru_get_option( 'haru_header', '' );
    
            if ( $haru_header_single ) {
                $header_layout = $haru_header_single;
            } else {
                $header_layout = $haru_header;
            }
    
            if ( $header_layout ) {
                return $header_layout;
            } else {
                return;
            }
        }
    
        add_filter( 'haru_get_header_layout', 'haru_get_header_layout' );
    }

    the change is added this:

    if ( is_shop() || is_tax( 'product_cat' ) || is_tax( 'product_tag' ) ) {
                $shop_page_id = get_option( 'woocommerce_shop_page_id' );
                $haru_header_single = get_post_meta( $shop_page_id, 'haru_header', true );
    }

    We’ll check and update this in the next version.
    Hope this helps!

    ****
    Regards,
    HaruTheme

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

You must be logged in to reply to this topic.