WordPress.org

Ready to get started?Download WordPress

Forums

Woocommerce (51 posts)

  1. ed
    Member
    Posted 2 years ago #

    Does anyone know how to fix the dropping sidebar issue with the Woocommerce plugin? This only happens on my main shop page (sidebar drops)....checkout and cart pages work great....

  2. CockpitSeeker
    Member
    Posted 2 years ago #

  3. CockpitSeeker
    Member
    Posted 2 years ago #

  4. CockpitSeeker
    Member
    Posted 2 years ago #

    I found my solution!

    Note: the solution depends on your theme

    In your theme/functions.php, add the following lines:

    // WOOCOMMERCE
    
    remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
    remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
    add_action('woocommerce_before_main_content', create_function('', 'echo "<div id=\"content-body\">";'), 10);
    add_action('woocommerce_after_main_content', create_function('', 'echo "</div>";'), 10);

    Instruction #1 and #2 (the ones starting with "remove") tells your theme to remove woocommerce hooks.

    Instruction #3 and #4 (the ones starting with "add") tells your theme to consider your own rules, rules that you must change to match your theme structure (whether you use div, class, section etc), that you can find in your theme/page.php.

    Here, what is specific for my theme is that I use:

    • "<div id=\"content-body\">" for #3 and
    • "</div>"

    but for some people, for instance, the hook can be:

    • "<section id=\"main\">" for instruction #3, and

    the closing instruction #4 will be:

    • "</section>"

    'Hope that helps anyone.
    Peace.

  5. ed
    Member
    Posted 2 years ago #

    Thanks so much I will let you know if this works out for me...I'm also having an issue with the lightbox effect "directing to Paypal" not working correctly...maybe javascript issues...what do you think?

  6. ed
    Member
    Posted 2 years ago #

    Here is the first few lines for code but it's not working for me `<?php get_header(); ?>

    <div class="container">
    <?php get_template_part('includes/breadcrumbs'); ?>
    <div id="content-area" class="clearfix">`

    that is my page.php. Just not working....

  7. CockpitSeeker
    Member
    Posted 2 years ago #

    I assume you tried to inject:
    "<div id=\"content-area\">" for instruction #3 and "</div>" for #4 in the 1st piece of code I pasted, and that you passed it in your theme/functions.php file right?

  8. ed
    Member
    Posted 2 years ago #

    yes did not work...I will try again

  9. ed
    Member
    Posted 2 years ago #

    I even followed these instructions http://www.woothemes.com/woocommerce-codex/theming-woocommerce/

    no dice

  10. CockpitSeeker
    Member
    Posted 2 years ago #

    er... then maybe you should look at your home page and check the output code (my chromium browser highlighted the different DIVs as I hovered the code and it's how I really found the name of the DIV used to contain all my website body's contents so I could rename woocommerce container into the one used by my theme).

    edit: Yeah I saw those links, it's exactly what I did, copying those 2x2 lines. I'm sure you just have to nail the exact name for the div/class/whatever for it to work.

  11. ed
    Member
    Posted 2 years ago #

    this is my demo site http://demos.muntzdesigns.com/

    Can you find it for me?

  12. CockpitSeeker
    Member
    Posted 2 years ago #

    Your wild guess wasn't too bad.

    I suggest you try those few (you missed the "container" div rendered just before the "content-area" div):

    • "<div class=\"container\">" as #3 and "</div>" for #4
    • or the next rendered div (the one you got) "<div id=\"content-area\" class=\"clearfix\">" as #3 and "</div>" for #4
    • or the same div by just putting "<div class=\"clearfix\">" as #3 and "</div>" for #4

    Let me know if it works

    edit: actually I see another one that could work:
    "<div id=\"left-area\">" #3 and "</div>" #4

  13. ed
    Member
    Posted 2 years ago #

    when i used "container/" the left side is correct and align perfect but the sidebar is still down...you think i should use another one with the container in #3

  14. CockpitSeeker
    Member
    Posted 2 years ago #

    Try "<div id=\"left-area\">" in #3...

  15. ed
    Member
    Posted 2 years ago #

    tried it...no dice...

  16. CockpitSeeker
    Member
    Posted 2 years ago #

    Then I don't see... :/ Except that you would have made an error in the syntax, putting a slach (/) instead of an anti-slash somewhere (\), or forgotten something...

    Last attempt, try "<div class=\"post entry clearfix\">"

    I'm going to troubleshoot the rest of the plugin, see if I get this paypal issue you were talking about

    edit: the left-area one looked like your best (because it doesn't spill over the sidebar) bet but eh...

  17. ed
    Member
    Posted 2 years ago #

    see this http://cl.ly/2i2N3x1D3P3u1H2c3W3I

    this is what happens when I add "<div id=\"left-area\">"

    the sidebar is up but everything drops in the footer (should be in the white background)

  18. ed
    Member
    Posted 2 years ago #

    here is the error with the paypal that I'm getting...see this site http://encorecoatings.com/

  19. CockpitSeeker
    Member
    Posted 2 years ago #

    Well, Im sorry but I see no other possibility for the template problem, for the other problem I'm still looking at it (I don't know yet if I have it), but it's going to be specific to your setup (check your cache plugins -if you have any- disable them, disable/enable some others that might be conflicting... it's the hard way but that's a developer's life I guess...

    I'll let you know if I found any other interesting stuff

    Cheerio

  20. mrbromley
    Member
    Posted 2 years ago #

    Hi,

    I cant work out why WC keeps locking up with a redirect error when you hit the proceed to checkout page.

    Error 310 (net::ERR_TOO_MANY_REDIRECTS): There were too many redirects.

    Any one else get this?

    Thanks

  21. ccantrell
    Member
    Posted 1 year ago #

    Did anyone find a solution for this? I have the page.php -> woocommerce.php solution working but would rather use this. I'm using elegantthemes estore. I'll ask over there too.
    -chris

  22. Nikitaxxx
    Member
    Posted 1 year ago #

    Hi all. I have the same problem of Ed
    I tried all DIV option in hooks but just i fix only the layout (which is a big step forward) but I can not display the side bar.
    Try, try and nothing
    I can not find solutions, because I also am not a programmer.
    Thanks for this thread that has helped me a lot but I need more help. :)

  23. CockpitSeeker
    Member
    Posted 1 year ago #

    If you expect any help, you should post a link to your website... ;)

  24. Eva
    Member
    Posted 1 year ago #

    Just wanted to say thanks to @CockpitSeeker for posting the function to re-hook the (custom) lay-out structure. Saved me a ton of work. Cheers!

  25. angel62990
    Member
    Posted 1 year ago #

    Hello i hope this simple CSS code works to all of the people who are looking to fix this problem, there is no need to touch the .PHP Codes just add this in the .CSS or in your Themes quick .CSS insert area.
    Added to the custom.css file
    Try this one first if no results try the second one.
    ///Sidebar Fixed CSS Code
    .container .clear {
    clear: right;
    }

    ///Sidebar Fixed CSS Code
    .container .clear {
    clear: none;
    }
    If it worked please reply and let me know good luck.

  26. anonimesone
    Member
    Posted 1 year ago #

    Uhm

    ok ... so u got a wordpress theme with a sidebar.
    your sidebar is totally messed up. well i guess it is.

    here is the fix.

    go to your wordpress themes folder and open up 'single.php' or 'page.php' with your favorite editor. notepad works.

    find out what the html code is around this line:
    <?php get_sidebar(); ?>

    yep you got it. there is a div around that line.
    Similar to this maybe:

    <div id="sidebar">
        <?php get_sidebar(); ?>
    </div><!-- End of sidebar -->
    <div class="clear"></div>

    or something else. It's what you need.

    ok so you now you know what is required.
    there is a file in the woocommerce plugin folder called 'sidebar.php'.
    The path to the file that needs to be edited can be found here '/plugins/woocommerce/templates/shop/sidebar.php'.

    all you need to do is to add the same code that you found in the single.php or page.php file around the line as above.

    to make sure that the file you are about to change does not mess up when updating woocommerce you need to do the following.

    make a folder in your themes folder called 'woocommerce'.
    in the 'woocommerce' folder make another folder called 'shop'.
    in the 'shop' folder copy the file called 'sidebar.php' into the 'shop' folder.
    edit the copied file and save it.
    so the file should be in the path:
    '/themes/<your theme folder>/woocommerce/shop/sidebar.php'

  27. Ferenc Vasóczki
    Member
    Posted 1 year ago #

    Hi!

    I found a solution for myself, maybe it is works only for me.

    I am using a template by templatemonster.
    My problem was, templatemonster theme added a class to the div id content, named two_third. This class has the following width propertiy: 65.33%

    Ok, so what i need only, to add this class for woocommerce.
    So i did navigate to file: wrapper-tart.php, and add this class to div with id="content". And viola, my page is works now.

    Anyway, if you know the with of your sidebar, you can easily set up a new selector for your content, and just insert your class into this {WOOCOMMERCEDIR}templates/shop/wrapper-start.php

  28. Ferenc Vasóczki
    Member
    Posted 1 year ago #

    Please let me know, if is this helped.

  29. waystid
    Member
    Posted 1 year ago #

    I could not understand what you were trying to say Ferenc :(

  30. warhedf1
    Member
    Posted 1 year ago #

    Ok, here goes my first post!
    I too have been having problems with getting the hooks mentioned above to work. So far, I've managed to get the hooks working (ALMOST!) on the site I'm building. The problem is that the pages that use the regular page.php file work fine, but the pages that are known to be the potential trouble makers "shop, single product page & taxonomy page" aren't rendering correctly.

    Here's an example of a page that "seems" to be working correctly:

    http://logoworks1.com/heybo_dev/?page_id=5

    And here's a link to a page where my footer floats up into the page and a div (along with it's background image) disappears.

    http://logoworks1.com/heybo_dev/?post_type=product

    It's as though there's a closing div missing which is preventing the div named "home-container_bottom" from even appearing. Wish I could figure this out!

    Somebody please help me! It's probably something simple, and I've firebugged this page to death, but still not seeing the solution.

    Thank you in advance for helping me! Very much appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic