Okay
  Public Ticket #1565984
Sidebar with menu on woocommerce product page
Closed

Comments

  •  1
    Sophie started the conversation

    Hi,

    People are complaining that it is not easy to navigate when on a woocommerce product page and would need to have a sidebar or a place under the page to be able to get on the list of categories for example.

    I have found no way to add a sidebar that is placed on each product page and common to all products.

    How can I do that?

    Thanks in advance for your answer,

    Sophie

  •  755
    Qode replied

    Hello there Sophie,

    Our theme doesn't have an option for a sidebar on a single product pages, bu there is a workaround. You need to modify one file in order to achieve that.

    The file that you need to change is content-single-product.php and it's on the following path: 

    wp-content/themes/bridge/woocommerce/content-single-product.php

    You need to replace the entire code with this code below: 

    <?php
    /**
     * The template for displaying product content in the single-product.php template
     *
     * Override this template by copying it to yourtheme/woocommerce/content-single-product.php
     *
     * @author         WooThemes
     * @package     WooCommerce/Templates
     * @version     1.6.4
     */
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    ?>
    <?php
        /**
         * woocommerce_before_single_product hook
         *
         * @hooked wc_print_notices - 10
         */
         do_action( 'woocommerce_before_single_product' );
         if ( post_password_required() ) {
             echo get_the_password_form();
             return;
         }
    ?>
    <div class="two_columns_25_75 background_color_sidebar grid2 clearfix">
        <div class="column1">
            <?php get_sidebar();?>
        </div>    
        <div class="column2">
            <div class="column_inner">
                <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class(); ?>>
                    <?php
                        /**
                         * woocommerce_before_single_product_summary hook
                         *
                         * @hooked woocommerce_show_product_sale_flash - 10
                         * @hooked woocommerce_show_product_images - 20
                         */
                        do_action( 'woocommerce_before_single_product_summary' );
                    ?>
                    <div class="summary entry-summary">
                            <div class="clearfix summary-inner">
                        <?php
                            /**
                             * woocommerce_single_product_summary hook
                             *
                             * @hooked woocommerce_template_single_title - 5
                             * @hooked woocommerce_template_single_price - 10
                             * @hooked woocommerce_template_single_excerpt - 20
                             * @hooked woocommerce_template_single_add_to_cart - 30
                             * @hooked woocommerce_template_single_meta - 40
                             * @hooked woocommerce_template_single_sharing - 50
                             */
                            do_action( 'woocommerce_single_product_summary' );
                        ?>
                    </div><!-- .summary -->
                    <?php
                        /**
                         * woocommerce_after_single_product_summary hook
                         *
                         * @hooked woocommerce_output_product_data_tabs - 10
                         * @hooked woocommerce_output_related_products - 20
                         */
                        do_action( 'woocommerce_after_single_product_summary' );
                    ?>
                    <meta itemprop="url" content="<?php the_permalink(); ?>" />
                </div><!-- #product-<?php the_ID(); ?> -->
            </div>
        </div>
    </div>            
    <?php do_action( 'woocommerce_after_single_product' ); ?>

    This is 1/4 left sidebar, if you want 1/3 then just instead of two_columns_75_25 add two_columns_66_33

    We suggest you to do this via child theme. This way, the modification will be preserved after the theme update and you won't change the parent theme files, which is a good practice. For this, you need to install child theme just like any other theme (the bridge-child.zip file is located in the folder with the installation files that you downloaded from Theme Forest) and activate it. Then you have to connect via FTP, create woocommerce folder inside bridge-child folder and place modified content-single-product.php file inside child theme's woocommerce folder.

    Hope this helps,

    Best Regards!

    The new and improved Online Bridge Documentation is live. Check it out now - LINK

    Best Regards,

    Qode

  • Tess replied

    Hey,

    I would like the same effect and copied and pasted the code below in the content-single-product.php file and uploaded it, but it did not change anything. How can I make it work?

    Greetings,

    Tess

  •  755
    Qode replied

    Hi there Tess,

    I have tested this locally and I can confirm that this is working. If you are having trouble with this, please open your own, separate ticket and provide a FTP access to your server so I can assist you with this further. Thanks.

    Best Regards,

    Walt

    The new and improved Online Bridge Documentation is live. Check it out now - LINK

    Best Regards,

    Qode

  • Tess replied

    Done.

    Thanks again!

  •  755
    Qode replied

    Hello again Tess,

    You are welcome, I am glad that worked out for you.

    Feel free to write us for any further assistance if needed.

    All the Best,

    Walt

    The new and improved Online Bridge Documentation is live. Check it out now - LINK

    Best Regards,

    Qode

  • Jorge replied

    Hello, it works very well. Thank you very much.

    But if I wanted to work on the page that shows the products of a category of wwocomerce?
    Would it be possible?
    Thank you very much.

  •  1,144
    Qode replied

    Hello Jorge,

    Default Woocommerce sidebar is already displayed in category pages, if you set it properly on main shop page. You don't have any additional coding for this. Please check example of category page from our demo sites:

    http://demo.qodeinteractive.com/bridge/product-category/cases/

    Best regards,

    Daniel

    The new and improved Online Bridge Documentation is live. Check it out now - LINK

    Also check our articles with useful tips and suggestions

    Best Regards,

    Qode

  • Jorge replied
    Thank you. But in our case it does not happen. We have put it with 3 columns and with sidebar, but none appears, is there an error?
    

    Attached files:  Captura.JPG

  •  466
    Qode replied

    Hi @Jorge,

    I'd appreciate if you could open a new ticket and include your wp-admin details, so I can log in and check it out. 

    I'm closing this one.

    Thanks!

    John

    The new and improved Online Bridge Documentation is live. Check it out now - http://bridge.qodeinteractive.com/

    QodeThemes Support Specialist

  • Jorge replied

    Thanks, we have already resolved

  •  466
    Qode replied

    Hi @Jorge,

    Great to hear it!

    However, I must repeat what my colleague John said previously and kindly remind you to open another ticket when/if issues arise.

    We are always here to help, and will try to do so as soon as possible.

    I will close this ticket now.

    Have a nice day!

    Sasha S

    The new and improved Online Bridge Documentation is live. Check it out now - http://bridge.qodeinteractive.com/

    QodeThemes Support Specialist