Before you ask please READ THIS

Sidebar on Product Category Page

edited March 2015 in Fame Posts: 3
Hi,

I don't know if this is possible. I wanted to have my product_category page with left sidebar based on Shop Widget.
It can be done by setting the SHOP page to sidebar left, but i want my Shop-page to be full-width. For more clear view:

Shop Page - Full-width Layout
Product Category Page - Sidebar Left(Shop Widget)
Individual Product Page - Full-Width Layout
Do you have php snippet to do this?

Regards
Jade,

Comments

  • AirAir
    Posts: 10,970
    Hello there:-)

    OK, so I have mess around and found solution. You will have to do following changes:
    1. You set your shop page as with sidebar turned off, but also choose sidebar to use.
    2. Go to fame\advance\utilities\custom.php
    3. Line ~71, change this
    
            elseif($shop_with_sidebar){
                $meta_id = woocommerce_get_page_id( 'shop' );
                $custom_sidebar = $apollo13->get_meta('_sidebar_to_show', $meta_id);
                if(strlen($custom_sidebar) && $custom_sidebar !== 'default'){
                    $test = $custom_sidebar;
                }
            }
    
    to
    
            elseif($shop_with_sidebar){
    	        if(is_product_taxonomy()){
    
    	            $meta_id = wc_get_page_id( 'shop' );
    	            $custom_sidebar = $apollo13->get_meta('_sidebar_to_show', $meta_id);
    	            if(strlen($custom_sidebar) && $custom_sidebar !== 'default'){
    	                $test = $custom_sidebar;
    	            }
    	        }
            }
    
    4. line ~252, change this
    
            elseif($page || $shop){
                //special treatment cause of children menu option
                $meta_id = $shop? woocommerce_get_page_id( 'shop' ) : get_the_ID();
                $sidebar = $apollo13->get_meta('_widget_area', $meta_id);
                if(strrchr($sidebar, 'left')){
                    $sidebar = 'left-sidebar';
                }
                elseif(strrchr($sidebar, 'right')){
                    $sidebar = 'right-sidebar';
                }
                __inner_a13_set_sidebar_class($mid_classes, $sidebar);
            }
    
    to
    
            elseif($page || $shop){
                //special treatment cause of children menu option
                $meta_id = $shop? wc_get_page_id( 'shop' ) : get_the_ID();
                $sidebar = $apollo13->get_meta('_widget_area', $meta_id);
                if(strrchr($sidebar, 'left')){
                    $sidebar = 'left-sidebar';
                }
                elseif(strrchr($sidebar, 'right')){
                    $sidebar = 'right-sidebar';
                }
    
    	        if($shop && is_product_taxonomy()){
    		        $sidebar = 'left-sidebar';
    	        }
                __inner_a13_set_sidebar_class($mid_classes, $sidebar);
            }
    
    It works for me:-)

    With kind regards.
  • Thank you :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!