WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Custom Product Taxonomy Templates (15 posts)

  1. sabahat
    Member
    Posted 1 year ago #

    Hi,

    I am using Woocommerce to build an online bookstore. I have added Authors as a product taxonomy, but am not familiar enough with woothemes to create a taxonomy template. For instance, what should it be called? taxonomy-product_auth???
    How can I attach images to each Author term?

    I could probably do this with a straightforward WordPress theme, but WooCommerce has me stumped. Can anyone help?

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

  2. Roy
    Member
    Posted 1 year ago #

    The taxonomy template WP uses if it finds it is taxonomy-{taxonomy}-{term}.php. If that is not found, then it looks for taxonomy-{taxonomy}.php.

    So in another words, you name the template filename to whatever your taxonomy name is. So if you registered it as product_author then your template filename should be taxonomy-product_author.php or you can use the more specific term name taxonomy-product_author-{term}.php

    Hope that helps.

  3. sabahat
    Member
    Posted 1 year ago #

    That's very helpful. Thanks. WIll try that and, if you don't mind, get back to you if I need more help.

    Do, by any chance, know how I can attach an image to each Author? I can use Description for the individual authors, but is there a function that allows me to attach an image that can be displayed on each Author page?

  4. Roy
    Member
    Posted 1 year ago #

    Well I don't know enough of what you're trying to do and why to know how to help. If you describe in detail, perhaps I can give some suggestions.

  5. sabahat
    Member
    Posted 1 year ago #

    Sure - the ecommerce store is for eBooks. Each book is categorized under various genres (for which I am using the product categories).

    Each book also has an author. I would like to list books by author, similar to a category template in WordPress. At the top of each template, I would like to place the name of the author, the author's picture and a short bio. If Author is a custom taxonomy within Products, will this be possible?

    I don't want to use the native WordPress User feature for this, though that may be what I will have to do if I cannot achieve this.

    I hope I am being clear - and thank you, by the way, for your help.

  6. Roy
    Member
    Posted 1 year ago #

    Ok but where will you store the author's information?

  7. sabahat
    Member
    Posted 1 year ago #

    That's what I am hoping to add to the Author names/terms. You can currently add a description - is there any way to add an image to each name?

  8. Roy
    Member
    Posted 1 year ago #

    Why not create a custom post type of authors and create as many custom meta you need to for it so you can add the author information bio...etc and yes including the image.

    Then in your product categories, you can add the authors and each product can have the author as the selected author for that product.

    So this way you style the author template however you like and have all the custom metas you need.

    Then in your authors template, you just need to query the products which have the same author name/slug as the currently view item.

  9. sabahat
    Member
    Posted 1 year ago #

    Interesting premise. I could still sort products by Authors then, but would have a separate link for the Author pages?

    That makes sense. A little long-winded, but probably the best solution for what I want.

    Thanks again, splashingpixels!

  10. Roy
    Member
    Posted 1 year ago #

    Right, so doing it the way I suggested would allow you to have a custom menu link in your site that says "shop by authors" or similar to your liking and that page pulls ONLY the authors info by name...Once they click on that particular author, then is where it will query that author to the product that is in "that" author's category.

    Make sense?

  11. sabahat
    Member
    Posted 1 year ago #

    Yes, it does.

    On each Author (custom post type) page, I would need a loop that would pull products by Author (the category, or attribute in woocommerce), which would appear under the Author info.

    Similarly, on product pages sorted by author, I could add a loop that would pull that author's info in the sidebar, or on the bottom of the page.

    If my authors register on the site as customers, though, that shouldn't cause any conflicts, should it? I guess I should be careful naming the post type and category.

  12. Roy
    Member
    Posted 1 year ago #

    You should be fine.

  13. sabahat
    Member
    Posted 1 year ago #

    Many thanks.

  14. woodsandhillsplc
    Member
    Posted 10 months ago #

    Hi Guys,

    I have set up a website for my Mum's rare books store ( http://www.wiganlanebooks.co.uk/ ).

    In a very similar situation where I would love to set up authors (using WooCommerce).

    I don't suppose you could explain the rough steps, or point me in the right direction?

    I have a reasonable understanding of WordPress but haven't created custom post types before.

    Big thanks
    Colin

  15. Banilla87
    Member
    Posted 6 months ago #

    Hi everybody!
    I'm trying to do the same thing but it's not easy.

    I created a custom taxonomy "author" associated with woocommerce product custom post type and it work!

    So if I click on a taxonomy term (es. "mister-x") I can view all the product of mistex-x.

    But I would like to add a photo and description of that author before the loop of posts..

    What I can do?

    Many Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic