[Support request] Show category on woo-coomerce tiles

Home Forums Support [Support request] Show category on woo-coomerce tiles

Home Forums Support Show category on woo-coomerce tiles

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1446864
    limolab

    Hello, in this page: https://shop.geogym.it/
    Is it possible to show the category on the tile of the product?
    Hope to be clear.
    Thanks

    #1446889
    David
    Staff
    Customer Support

    Hi there,

    where would you want the Category name displayed ? Above the single product title ?

    #1446955
    limolab

    Hello, yes on the tile, under the title.
    Thanks.

    #1447061
    David
    Staff
    Customer Support

    Ok so try this:

    1. Create a new Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    2. Add this code to the Hook element text area:

    <?php 
    $terms = get_the_terms( $post->ID, 'product_cat' );
    if ( $terms && ! is_wp_error( $terms ) ) :
        if ( isset( $terms ) ) {
    	echo '<span class="woo-cat-term">' . $terms[0]->name . '</span>';
        }?>
    <?php endif;?>

    3. Select the woocommerce_single_product_summary hook from the hook list
    4. Check Execute PHP
    5. Set the Priority to 9
    6. On Display Rules set Location to Products > All Products

    #1447095
    limolab

    Hi, thanks for your quick response.
    woocommerce_single_product_summary_hook i can’t find this on the hook list, i find only this: woocommerce_single_product_summary, i don’t know if it’s the same.

    I’ve follow the procedure but still doesn’t work.
    Hope to be clear.
    Thanks

    #1447108
    David
    Staff
    Customer Support

    Oops – that was my typo – yes thats the correct hook. I corrected the code above.

    I just checked your site and I can see the Category below the title on the Single Product page.

    Do you want this to appear in the Product Archives ?

    #1447114
    limolab

    Hello. No problem 🙂

    yeah i’d like to see the category on the tiles in the home page.

    In this section:-> I PRODOTTI GEOGYM
    Is it possible to do that?
    Thanks.

    #1447138
    David
    Staff
    Customer Support

    Change the Display Rules to Product Archive which is the Shop Page.

    #1447310
    limolab

    Hi, thanks for yor response.
    Can you be please more specific?
    Where can i find “Product Archive” ?

    Thanks

    #1447356
    Leo
    Staff
    Customer Support

    SHould be in the display rules towards the bottom:
    https://www.screencast.com/t/5bCGgFFEUoBx

    #1447377
    limolab

    Hello.
    Thanks for your response.
    unfortunately still doesn’t work.
    I can give you the access to my site if you want.
    Thanks.

    #1447386
    Leo
    Staff
    Customer Support

    Sorry what doesn’t work? The display rules?

    #1447388
    limolab

    Yes, i’d like to show the category name under the title of the product in this page -> https://shop.geogym.it/
    But as you can see it show only the title of the product and not the category.
    Hope to be clear.
    Thanks

    #1447431
    David
    Staff
    Customer Support

    Follow the steps here:

    https://generatepress.com/forums/topic/show-category-on-woo-coomerce-tiles/#post-1447061

    And set the following Display Rules to:
    1. Location > Product Archive
    2. Location > Product Category Archives > All Archives.

    #1448163
    limolab

    Hello,
    I’ve follow the steps.
    Still doesn’t work.

    View post on imgur.com


    see the screenshot.
    If you want i can give you the access.

    Thanks

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.