WooCommerce Category Descriptions

As discussed in the community forum, i'm raising a ticket for help locating the category description issue

  • Adam Czajczyk
    • Support Gorilla

    Hi Russell

    I hope you're well today and thank you for your question!

    Just to make it clear for my colleagues and other Members that could look into this ticket, you're referring to this discussion on Members forum:

    https://premium.wpmudev.org/forums/topic/woocommerce-category-descriptions

    I've seen your response there and I would simply move that discussion from the Members forum to the Support ticket but this way is fine too, so I'll leave that other one intact there in this case :slight_smile:

    I looked into the site and I found this code that seems to be fired exactly in the place where you see those additional content (e.g. "Example of jars" sub-title followed by a set of photos):

    <?php
     $tid=get_queried_object()->term_id;
     $meta = get_term_meta( $tid );
    		 $thumb_id = $meta['details'][0]; 
    
    		 echo  do_shortcode($thumb_id);
    		?>

    It's located in the /woocommerce/archive-product.php template file in the active theme folder.

    This doesn't look like a "native" code and surely it's not in a Lite version of the theme, though I'm not sure about whether it should or shouldn't be in a full version of the theme (as I only have access to the lite one). But it looks like something that was actually added there.

    I think this might be it. I didn't try to remove it from there, even temporarily, as if anything went wrong I wouldn't be able to revert changes, but you might want to give it a go and see if without this code that "extra data" is still there (just remember that you might need to clear cache to see result).

    What this code does is it

    - finds out what "object" is currently displayed (e.g. whether it's a product or a category)
    - get's an ID of it (of a category in this case)
    - reads associated meta data from the database and apparently that might contain some sort of a shortcode that's then executed

    If you do have direct access to the database and are familiar a bit with phpMyAdmin usage, you could actually try to check this:

    - look into the database and find the "_termmeta" table (with default prefix it would be "wp_termmeta" but prefix might be different for your site)

    - in that table do a search for meta_key "details" and term_id 13 (13 would be term ID for "Jars" category)

    - see what's the value of the meta_value

    That might give us some insight if I'm not mistaken.

    Best regards,
    Adam

  • Russell
    • Flash Drive

    Thanks for your help. You're correct - there is content in the meta_value field that's generating the category descriptions. What i'm not sure about is how it got there but at least I can manually update the table if necessary.

    Thanks Adam, your help is much appreciated.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.