WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[Plugin: WooCommerce - eCommerce plugin for WordPress] Template problem (61 posts)

  1. owcv
    Member
    Posted 2 years ago #

    Some shop pages (all products, single, category) change my theme layout, e.g. my sidebar is replaced with the standard one and is outputted below the shop content instead of on the right side. Also the footer is resized. One of the developers of the theme (Atahualpa) I use wrote:

    "Atahualpa sets a global variable '$cols'. I would guess that WooCommerce is using that same variable and not resetting it to it's existing value. You should contact the plugin author about this."
    http://forum.bytesforall.com/showthread.php?t=15624

    Can you help with this?

    http://wordpress.org/extend/plugins/woocommerce/

  2. AminkaOzmun
    Member
    Posted 2 years ago #

    I have a very similar problem, it seems.

    I'm using the InStyle theme from Elegant Themes and on the product pages the layout's totally messed up, with the sidebar underneath the content and the featured image stretched out, et cetera -- generally, a mess.

    I've looked at the WooCommerce User's Guide but everything seems so simple; not sure why images are not working properly, being forcibly stretched out no matter what setting I poke at. I even looked at the WooCommerce Codex and copy-pasted the snippets of code they offered to no avail.

    Interesting, the cart page is just fine!

  3. owcv
    Member
    Posted 2 years ago #

    In the changelog of 1.1.2 is stated:

    "Renamed $columns global for compatibility with certain themes"

    Unfortunately the problem still persists...

  4. bmwright005
    Member
    Posted 2 years ago #

    Any solutions to this issue yet? I am having the same issue. Also having an issue of product just not showing up at all in the "shop" page.

  5. SoulOnFiya
    Member
    Posted 2 years ago #

    I had the same problem and found the solution here.
    This is what removed the sidebar

    Unhook (remove) the WooCommerce sidebar on archive pages

    add_action('wp', create_function("", "if (is_archive(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    Unhook (remove) the WooCommerce sidebar on individual product pages

    add_action('wp', create_function("", "if (is_singular(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    Unhook (remove) the WooCommerce sidebar on all pages

    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);

  6. Kurukulie
    Member
    Posted 2 years ago #

    I have the same problem as Aminka Ozmun....
    I kind of understand the hook thing SoulOn Fiya but I just don't know where to place the code...which file I need to add it to, in which folder.....
    I'm fairly new at wp and new to code too!!
    I am using a Pleng (themeforest) and building my site locally.
    I have dreamweaver and good old text edit as far as programs are concerned.
    Could anyone point me in the right direction... to a video... tutorial ....or be totally amazing and tell me.
    Pretty please :) ....

  7. SoulOnFiya
    Member
    Posted 2 years ago #

    Open up dreamweaver and look for the functions.php file in your Pleng theme folder. I added it towards the end so before the ?>. You also can add // WooCommerce before it so you'll know where to find it in the future. so it would like this;

    // WooCommerce
    add_action('wp', create_function("", "if (is_archive(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    Unhook (remove) the WooCommerce sidebar on individual product pages

    add_action('wp', create_function("", "if (is_singular(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    Unhook (remove) the WooCommerce sidebar on all pages

    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);

  8. Kurukulie
    Member
    Posted 2 years ago #

    Hey SoulOnFya,
    Thanks heaps for taking the time to reply!!!
    Unfortunately it didn't work, it seems that all my content on the woocommerce pages still look like they are in the header section and are still messing up my layout... :(
    Oh well, guess I will keep trolling the internet to see if anyone else has the same problem and has found a solution.
    Thanks again!!!
    Josie

  9. gearheaddeals
    Member
    Posted 2 years ago #

    I am having this same problem with a customer's site. They are running graphene theme and it moves the sidebar to the bottom of all pages. I tried the above fix by editing the functions.php file and it killed the site giving a 404 error. I had to reload wordpress because as many times as I tried and different ways to re-upload the original functions.php, it would not resolve itself.
    I've contacted the owner of woocommerce and we are discussing over email. Hopefully they can build in a robust bit of code that prevents this from happening.

    Anyone else?

  10. SoulOnFiya
    Member
    Posted 2 years ago #

    that's weird cause it worked for me. I'm using the hybrid theme so the set up might be different. Are you guys making changes in a child theme? That's the safest way. Theres usually a folder within you theme folder called includes that my contain additional functions.php files. You might want to look in their.

    Hoping somebody with more experience with this could hop on and add more input.

  11. gearheaddeals
    Member
    Posted 2 years ago #

    So which functions.php file is accessed through /wp-admin?
    Isn't that the child theme file?

  12. SoulOnFiya
    Member
    Posted 2 years ago #

    If you have a child theme yes. I just know some themes have a an includes folder sometimes that have a functions.php file but that not the case for all.

    I'm testing another theme to see if I can figure this out and still googling more solutions. My biggest issue with woo commerce is not being able to assign a page template like my regular pages.

  13. salsatrips
    Member
    Posted 2 years ago #

    woocommerce causes the same issue with Thesis and some other themes, which I have tried. Did anybody find a solution to it? Thank you

  14. epistates
    Member
    Posted 2 years ago #

    you only could fix it with using a childtheme of woocommerce styles inside your theme folder. here is described how:
    http://www.woothemes.com/woocommerce-codex/theming-woocommerce/

    not a very good solution though, because unfortunately you have to upload that folder over and over again after every update.

    the other mess is, that woocommerce loads tons of css, js and so on, when i open my website. what slows it down. would be better if woocommerce only loads styles and scripts when needed.

  15. sidd82
    Member
    Posted 2 years ago #

    This solved the problem for me :)

  16. salsatrips
    Member
    Posted 2 years ago #

    The last post is about Jigoshop. Even that I learned that they are similar, I don't know, how to adopt the code to get woocommerce running with Thesis. Can anybody help implementing one of the suggestions? Please pm to mail@salsa-trips.com THX!

  17. owcv
    Member
    Posted 2 years ago #

    Is there a special reason why WooCommerce needs to load its own sidebar?

    It messes up my theme layout, so i commented it out:

    <?php // do_action('woocommerce_sidebar'); ?>

    And now everything looks fine again.

  18. holywebmaker
    Member
    Posted 2 years ago #

    It is explained pretty clearly here:

    http://www.woothemes.com/woocommerce-codex/theming-woocommerce/

    Create a functions.php in your child theme and add this line to it. This is my current functions.php file in my child theme

    <?php
    
    /*-----------------------------------------------------------------------------------*/
    /* You can add custom functions below */
    /*-----------------------------------------------------------------------------------*/
    
    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);
    
    /*-----------------------------------------------------------------------------------*/
    /* Don't add any code below here or the sky will fall down */
    /*-----------------------------------------------------------------------------------*/
    ?>

    Worked for me.

  19. albertorrent
    Member
    Posted 2 years ago #

    I'm having the same problems, does anyone known how to fix exactly?

    I used that guide.
    http://www.woothemes.com/woocommerce-docs/codex/third-party-custom-theme-compatibility/

    And my site
    http://www.aceiteslaescarapela.com/tienda

  20. hilmon
    Member
    Posted 2 years ago #

    Further to @holywebmaker ...

    Here's the list of hooks so you can remove the ones you don't want...

    such as...
    remove_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10 );

    https://github.com/woothemes/woocommerce/blob/master/woocommerce-hooks.php

  21. nastynupe
    Member
    Posted 2 years ago #

    hi i'm kind of new to this. i was trying to integrate woocommerce with artisteer themes and i am having a similar problem as above. sidebar generated beneath content, unstyled, on product pages. i have been trying to figure out how to unhook and add code but i cant figure it out. by any chance does someone have a video posted of this process? i dont seem to get it doing it by the written explanations. i'm not a coder so i may need a remedial explanation

  22. rqp
    Member
    Posted 2 years ago #

    I second that, nastynupe. I know just enough code to make cosmetic changes, but not much more, and I'm having lots of problems with this. To repeat what others have said, the sidebar is below the content on the shop and product pages, but the other WooCommerce pages work perfectly.

    I've tried the plugin with both the Classica and Minibuzz themes and had the same problem with both. I was able to get rid of the sidebar completely using holywebmaker's code, but that's not what I want. I'd like a sidebar on the shop and product pages for the various WooCommerce widgets. Plus, when I removed the code from the functions.php, it killed the site, and I had to delete and reinstall the theme.

    I'm concerned that if I unhook the sidebar, it will affect the pages that are working.

    For those who've managed to fix this issue while keeping a sidebar on the shop and product pages, would it be too much trouble to ask for some very detailed instructions for those of us with limited coding knowledge?

  23. jtintner
    Member
    Posted 2 years ago #

    I'm having a very similar problem but it seems to be a little bit differnt than what some are experiencing. I also am using an elegant theme and have actually tried 3 differnt ones all of which keep seeming to have the same issue.

    This is supposed to be the shopping cart page

    And this is the
    My Account Page

    Which BOTH are supposedly using the WooCommerce.

    I'm not sure why all the styling on the Test Page is all screwy though. Anyone have an idea how to fix this?

    I tried going into my Themes Functions file and adding in that code

    // WooCommerce
    add_action('wp', create_function("", "if (is_archive(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    
    add_action('wp', create_function("", "if (is_singular(array('product'))) remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);") );
    
    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10);

    but had no success. I don't believe this is an issue with hooks but something that its placing the actual store in the wrong location of the theme... Just wagering a guess

    Please help someone :)

  24. owcv
    Member
    Posted 2 years ago #

    What I do not understand is, why the WooCommerce programmers not just get rid off their own templates. Why can't we simply use our own theming and styling?

  25. webbrewers
    Member
    Posted 2 years ago #

    Same thing happens with premium wootheme themes but not some free themes I've tried. I guess they don't want us to use woocommerce.

  26. hausbrau
    Member
    Posted 2 years ago #

    I've changed my WP page templates for each of the WooCommerce pages to "widescreen", which eliminates my sidebar - not ideal, but a work around.

    HOWEVER, the product page seems to be the only one that does not have a titled WP page and therefore, I can't change the product page template...still experiencing the sidebar on product page being pushed to below the content.

    Anything? Bueller? Bueller?

  27. xsaint
    Member
    Posted 2 years ago #

    SOLUTION / WORKAROUND

    you can use Widget Context plugin to solve your problems. This plugin allows you to hide certain widgets from certain pages.

    Step 1: Install and activate Widget Context plugin
    step 2: go to the apperance->wiget setting page
    step 3: on the side bar, click on the widget you want to hide. Now you will see the plugin in play and you will see the plugin options
    step 4:on the Widget Context options select > Hide on selected
    Step 5:on "or target by URL" enter the full url of the pages you want to hide the widgets.

    For example, if your domain is http://www.abcd12345.com and you want to hide the widgets on the shop pages, then enter as follows
    http://www.abcd12345.com/shop/
    http://www.abcd12345.com/shop
    http://www.abcd12345.com/shop*
    http://www.abcd12345.com/shop/*

    Step 6: Save and close the settings

    Check the page and the widget should be gone.

    Good luck!

  28. mkrapf
    Member
    Posted 1 year ago #

    To get WC working with your custom theme, duplicate your theme's page.php, rename it woocommerce.php and inside look for the 'loop'.

    http://codex.wordpress.org/The_Loop

    Replace the loop with:

    <?php woocommerce_content(); ?>

    That should resolve all sidebar issues, as they will work like your other theme pages.

  29. sbgraf
    Member
    Posted 1 year ago #

    hi all
    to replace the loop work really good. but i have a new problem: i can't put the breadcrumbs like i have in my own theme:

    <?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>

    this effects a catchable fatal error: object of class wp_error could not be converted to string in .../mytheme/functions.php on line 335

    line 335 of functions.php is

    echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');

    so i guess there is a problem with the categories of woocommerce. have somebody an idea?

  30. OFGC
    Member
    Posted 1 year ago #

    @mkrapf
    1. am i supposed to be replacing the original woocommerce.php file with the one i made from the page.php file?

    2.and also my theme doesn't actually have a page.php file should i use my index.php instead??

    3. if i should use my index.php file instead im not exactly sure where the loop starts here is my index file here

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic