WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] [Plugin: WooCommerce] Customising the shop base page (19 posts)

  1. pandaj
    Member
    Posted 1 year ago #

    What's the easiest way to customise the shop base page? I can't find a template file for it and need to change a few things such a widget displaying that shouldn't, removing the dropdown sort option and the general style.

    It'd be nice to change it so that the title isn't the 'Site Title - Tagline'.

    Thanks

  2. pandaj
    Member
    Posted 1 year ago #

    gaaah didn't realise it was an archive! found the template file.

  3. boldt
    Member
    Posted 1 year ago #

    if you want to remove the dropdown sort option you shall open your theme functions.php and add following line:
    remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );

    in general, is it possible eliminate elements from your woocommerce design using a remove_action.

    In woocommerce plugin is a file called woocommerce-hooks.php inside this file is listed all elements of the various elements of the wep-shop-pages, which all can be removed this way.

    Just find line add_action line you want to remove cope the line into functions.php and overwrite "add" with "remove".

    I have created a woocommerce webshop using a standard theme.
    I preferred to work with Weaver ii because of its flexibility, but this was actual a hindrance to achieve my goal, so I shifted to TwentyEleven. But also this theme had some issues especially with the sidebar widgets during the process.

    So once again I changed theme. Twentyten makes no problem with widgets. Instead I modified the CSS to the result I wanted.
    (I have now renamed the theme, so it wont disappear when updating.)

  4. cbigler
    Member
    Posted 1 year ago #

    @pandaj

    You mentioned archive/template file for editing the shop's base page's title.

    Can you elaborate on how you did that exactly as I'd love to find the way to customize the page's <title>.

    Thanks,
    Chris

  5. pandaj
    Member
    Posted 1 year ago #

    @cbigler I added a line to echo the title at the top of the 'archive-product.php' page which seemed to work, just above the header.

    echo "<title>SHOP</title>";
    get_header('shop'); ?>
  6. cbigler
    Member
    Posted 1 year ago #

    You did that with a Woocommerce theme?

    With the WPFlexiShopTwo theme, I edited /wp-content/themes/wpflexishoptwo/core/frontend/head.php to have the following:
    // --------------------------------------
    elseif ( is_post_type_archive('product') ) {
    $title = get_post_meta(woocommerce_get_page_id('catalog'), 'seo_title', true);
    }
    // --------------------------------------

    That works on that theme. My problem is how to do it on the twentytwelve default theme?

    CHris

  7. pandaj
    Member
    Posted 1 year ago #

    No I did it with my own theme, referring to: http://wcdocs.woothemes.com/codex/template-structure/

  8. cbigler
    Member
    Posted 1 year ago #

    I think that's what I need to do - build my own theme actually. I'm great with HTML, etc ... how long did it take you to build your theme? I have almost all of the HTML done, so I'm it wouldn't be more than 1 to 2 weeks.

  9. cbigler
    Member
    Posted 1 year ago #

    Got it ... thank you for that; it's what I need it to be now. Thanks again! Chris

  10. cbigler
    Member
    Posted 1 year ago #

    On the twenty twelve theme, that doesn't produce the correct result as it places a <title> tag at the very beginning of the (Woocommerce) base shop page ... before all other HTML.

    That's incorrect; you end up with 2 <title> tags on your page, as well as invalid HTML.

    Instead, if you have Yoast's WordPress SEO plugin installed ... do this:

    1. Visit http://yourdomain.com/wp-admin/admin.php?page=wpseo_titles#top#post_types
    2. At bottom of that page in the "Custom Post Type Archives" section, enter your desired title in the "Title" field.
      • Example: Vanilla Ice Cream

    ---------------
    DONE

  11. Matt
    Member
    Posted 1 year ago #

    @cbigler I tried that with no success. But here is my current work around.

    Inside header.php I replaced my <title> tag with:
    <title><?php if (is_shop()){ echo "Shop Title Here!!! Yahooo";} else{the_title();}?></title>

    Cheers

  12. cbigler
    Member
    Posted 1 year ago #

    @Matt ... On the Abundance theme my header.php has (the typical) title as:
    <title><?php is_home() ? bloginfo('description') : wp_title(''); ?></title>

    ^ That's working

    I like your solution better actually ... I'd rather it be hard coded like that, so thank you for sharing the code!

  13. Matt
    Member
    Posted 1 year ago #

    @cbigler

    I try not to hard code things too much, but since I manage the site and needed this up quickly, it works.

    Cheers!

  14. cbigler
    Member
    Posted 1 year ago #

    @Matt ... Quick update ...

    I replaced my header.php's <title> code with what you're using, but take a look at your Woocommerce categories and see if it displays the correct title. It didn't for me, so I combined ours and it works as it should.

    Here's what I have:
    <title><?php if (is_shop()){ echo "Shop Title Here!!! Yahooo";} else{wp_title('');}?></title>
    ------------------------------------
    My particular set up is:
    - Abundance theme
    - Yoast's WordPress SEO
    - Code sample above for <title>

  15. Matt
    Member
    Posted 1 year ago #

    I don't have categories listed or visible by search as we are running an interesting setup.

    I haven't checked but is wp_title('') compatible with Yoast SEO? I thought that was always supposted to be the_title()?

  16. cbigler
    Member
    Posted 1 year ago #

    It was a quick copy/paste while I ssh'd in, saved and voila ... worked. :)

  17. mdellinger
    Member
    Posted 1 year ago #

    I'm having an issue with trying to customize the the Shop Base Page on my site.

    I've saved the archive-product.php into my template folder:

    /wp-content/themes/Dorothy/woocommerce/archive-product.php

    But it doesn't seem to be taking any of the changes I'm making. This is especially strange because I am able to edit the individual product pages already, so I know this should work, for some reason it just isn't.

    Is there some other file I need to working with? I'm also using the Yoast SEO plugin in case that might be creating some issue.

  18. tfink12
    Member
    Posted 1 year ago #

    @mdellinger I had the same issue as you. For some reason I could not change the shop base page until I decided to take measures into my own hands.

    In archive-product.php I commented out these two lines:

    do_action('woocommerce_before_main_content')
    do_action('woocommerce_after_main_content')

    I then added the div id's and class wrappers I wanted since I have a custom theme in place. I added the divs straight to this page and it worked just as I wanted it too.

    When you comment these lines out you will lose the breadcrumb because it is hooked into the "woocommerce_before_main_content" hook but you can add that if you want. I left mine out.

  19. mikelawton86
    Member
    Posted 10 months ago #

    I tried following these instructions and was still unable to edit the Shop base template (archive-product.php).

    I tried tfink12's method of commenting out `do_action('woocommerce_before_main_content')
    do_action('woocommerce_after_main_content')`
    but still nothing.

    As a last ditch attempt I copied all my necessary files (the new woocommerce folder, + any files/folders that I had previously edited to create my own theme) from my old template folder into the twentyTwelve template folder and it worked straight away.

    Hope this helps someone!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic