WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
I can't believe Woo have done this (Default Right side bar) (23 posts)

  1. Melpomene
    Member
    Posted 10 months ago #

    Like I said, I can't believe they have, so logically it's something that I'm failing to put right.

    In WP we have a page attribute that allows us to set it at 'default' or 'full width'. Well when I've downloaded the Woo Plug In, this attribute doesn't show, so I'm saddled with a default setting that has a right side bar showing

    http://www.faraway-fairways.com/product/may-19th-25th-east-coast-st-andrews-focused-tour/

    Now I'm using right side bars elsewhere in the site, so am a bit nervous about attempting to guess my way round any CSS (and definitely PHP solution). Logically I thought there must be something in 'settings' that allows me to put it on full width, but if there is I can't spot it?

    Now I can't believe for one second Woo have hard coded something so restrictive as a default right side bar, and surely there must be a very simple 1 minute solution to putting a page on full width.

    I should perhaps say I'm using the Plug In, and not a Woo theme. The only time I tried to integrate a Woo theme with a web site theme was a complete disaster as they went into conflict and I lost about 2 days work having re-enter all the navigation again, so I'm a bit nervous about bringing a Woo theme in ever since.

    Any help, as always, appreciated folks

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

  2. Kramarz
    Member
    Posted 10 months ago #

    Not 100% sure what you mean, but when you go to your shop page, there's a widget called 'Options of page' and in it one of options says 'Layout Page' which you can set to no sidebar/left sidebar/right sidebar, is that what you're looking for?

    EDIT: Never mind actually I based that on what I have, which is most likely a theme that I'm using feature, rofl. Sorry. Problem stays.

  3. Kramarz
    Member
    Posted 10 months ago #

    Anyway, think you will need to use hooks to change templates layout, or change the templates themselves, but I'm no guru in that topic just yet, so gonna leave it for someone smarter!

  4. Melpomene
    Member
    Posted 10 months ago #

    It feels as if it should be something that straight-forward Kramarz, but I think as you've worked out, it might not be.

    The shop page is one that can be set at full width using the normal page attribute, but doing this seems to make no difference to the display. The option to set the product pages at full width doesn't exist with no page attribute box showing in order to make that setting. Even if there were, you suspect it wouldn't work aka the shop page

    There are a few widgets that have come in from the plug in, but I'm not sure what they are or what they can do

    It looks pretty ugly as things stand though

  5. Melpomene
    Member
    Posted 10 months ago #

    Terrified as I am to perform anything that involves PHP, I did have a tentative dig in the PHP template file called main.woocommerce and found this little item, which my extremely limited understanding of such issues would lead me to conclude that some default sidebar has indeed been coded into the plug-in

    <!-- SIDEBAR -->
    <div class="sidebar">

    {dynamicSidebar "shop-sidebar"}

    </div><!-- end of sidebar -->

    Now I want sidebars to appear elsewhere in the site and have had to use a plug-in to support this due to limitations in the theme, but I don't want them on the Woo pages

    I guess there's two questions really:

    1: Is this PHP the offender that's causing a side bar to display?
    2: How do I disable it safely?

    I'm sure there's something you can do involving /* or */ isn't there? If that's right? where abouts would you wrap it round the PHP?

  6. Roy Ho
    Member
    Posted 10 months ago #

    Put this in your themes functions.php file.

    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
  7. Melpomene
    Member
    Posted 10 months ago #

    Thankyou, something tells me this might do the trick, but before I do, (and at great risk of inviting a very easy one-liner!!) is there any specific space I need to put it?

  8. Melpomene
    Member
    Posted 10 months ago #

    I should clarify,

    you've specified 'theme function' so I'm not to put it in the woo.commerce PHP file? OK that bit I understand, but I was always under the impression you couldn't go round putting PHP in anywhere in a theme a file, and that it had to put in an appropriate location? is that right? or can I just put it anywhere like I might customised CSS?

  9. Roy Ho
    Member
    Posted 10 months ago #

    It can go anywhere in the theme's functions.php file...

  10. Roy Ho
    Member
    Posted 10 months ago #

    Don't be scare of your own site...best way to learn is just do it...if it breaks great, now you know better and learn from it...

  11. Melpomene
    Member
    Posted 10 months ago #

    Ok I tried it, but it hasn't worked.

    Hasn't crashed anything either, so that's a relief

  12. Roy Ho
    Member
    Posted 10 months ago #

    If it doesn't work then that means it is not WC's sidebar you're trying to get rid of, its your other sidebars probably from your theme.

    The code I gave you is specific to WC and will not work if your theme or any other plugin is adding the sidebar in. For those you need to look at the code from them to know how to remove it on shop pages.

  13. Melpomene
    Member
    Posted 10 months ago #

    Bear with me, I'll see if I can find it.

    It did seem strange that Woo would put something like a sidebar in without an easy way of removing it.

    I'm assuming it's come with the plug-in then (which also seems to have disabled the visual editor too)

  14. Roy Ho
    Member
    Posted 10 months ago #

    No it is NOT WC's fault. The person who is building the site with WC SHOULD know what he/she is doing and it involves knowing actual code and how it works.

  15. Melpomene
    Member
    Posted 10 months ago #

    I can't spot any evidence of the plug in in the functions PHP file.

    Let me try and explain a bit and see if it helps (i might accidentally throw light on something significant)

    I've had to use a plug-in called 'custom sidebars' by Javier Marquez, due to limitations of a theme that I haven't been particularly impressed with. This worked anyway, and I was able to set indvidual pages with discretion, at either template (sidebars) or full width, as normal in the WP page attribute. Critically I had the capacity to mix and match my pages to display a sidebar or otherwise, and this is the capacity I seem to have lost for the Woo pages

    When I brought the Woo commerce plug into the site everything went reasonably smoothly with the exception of this display issue. Only the Shop page offers me the page attribute setting though through WP, it simply doesn't appear as an option for the product pages which is where the damage is being done (I think)

    Even though the shop page is set at full-width, its displaying the default though with an unpopulated side bar

  16. Roy Ho
    Member
    Posted 10 months ago #

    You should turn off that sidebar plugin and use the code I mentioned above to see if that combination works for you.

  17. Melpomene
    Member
    Posted 10 months ago #

    I'm trying to think this through using my extremely limited understanding of these things.

    We're reasonably confident that the offending 'thing' is the plug in 'custom sidebars'?

    This is quite an integral part of the main website though and one I'd be reluctant to lose at this stage

    For this plug in to work, it must have generated some function PHP somewhere when it was introduced, and then things like colour and font have been altered using CSS

    The question I suppose is where would I go looking for this plug ins PHP? I didn't spot it in the PHP theme file, the only side bar references in their were to the themes own (AIT) which don't work, but would the plug in have replaced these for functioning purposes?

    I've found this bit related to the plug in which I have to say means nothing to me,

    "These replacements will be applied to every entry post that matches a certain post type or category.

    The sidebars by categories work in a hierarchycal way, if a post belongs to a parent and a child category it will show the child category sidebars if they are defined, otherwise it will show the parent ones. If no category sidebar for post are defined, the post will show the post post-type sidebar. If none of those sidebars are defined, the theme default sidebar is shown."

  18. Melpomene
    Member
    Posted 10 months ago #

    If I turned off the side bar plug in? would that ultimately mean that the sidebars are lost though? If I turn it off do I lose all the code and the widgets? I seem to think that's happened before to me?

    Without this navigation a customer couldn't get to the Woo sections anyway to place an order, unless I can find another way of navigating them on what would be the mother of bottom menu bars!!!

  19. Kramarz
    Member
    Posted 10 months ago #

    As far as I can see after inspecting your website, it could be theme itself related, somewhere in settings, cause that's what you have in css for those pages with sidebar:

    .subpage .mainbar {
    float: left;
    width: 660px;
    }

    and then for the sidebar part

    .subpage .sidebar {
    float: left;
    padding-bottom: 20px;
    padding-left: 80px;
    width: 220px;
    }

    which would suggest it's the layout forced by the theme you're using maybe?

  20. Roy Ho
    Member
    Posted 10 months ago #

    @Melpomene - what I asked you to do isn't to say don't use the sidebar plugin. It is to TEST if that is the reason. This is called troubleshooting. Without knowing the cause, how can you fix something right? So I was asking you to turn that off and use the remove code and see if on shop pages, the sidebar still appears or not...But if you're afraid that by turning off the sidebar plugin, you may lose your settings then I am afraid I can't help with that.

  21. Melpomene
    Member
    Posted 10 months ago #

    After deactivating it, the main site (theme) left an empty side bar in place as a default, that went to full width when the page attribute was altered accordingly

    The Woo pages it made no difference to because the page attribute setting box doesn't appear on the right hand side in the editor

    Even the shop page, which is the one that does offer me the option of setting it at full width, isn't responding to the instruction to do so

  22. Melpomene
    Member
    Posted 10 months ago #

    I'm thinking that perhaps a bottom menu bar (which the theme does support apparently) might be capable of performing the task of the side bar, but as things stand it doesn't really seem to have resolved the issue of this empty side bar default appearing in the Woo pages

  23. Roy Ho
    Member
    Posted 10 months ago #

    The settings you see in the SHOP page will not work as WC does not use the standard page.php file template. Instead it has its own which are all in the templates folder of WC's plugin. But regardless of this, if you already removed the code as what I mentioned, the sidebar for WC, will not show.

    But I think your new problem now is not the sidebar and perhaps is the full width issue? If that is the case, that is a layout issue which you need to change in the WC's loop start and loop end. You should read the docs on how to do this on their site.

    Start with this -> http://docs.woothemes.com/documentation/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.