WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Product category list on product pages (9 posts)

  1. Netflora
    Member
    Posted 1 year ago #

    Is there a simple way to get rid of the list of categories that shows alongside the image and beneath the price on the single product pages?

    Some of our products belong in multiple categories and it looks really messy having that long list there.

    Charlie

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

  2. danbodenstein
    Member
    Posted 1 year ago #

    You can override the template used.

    copy the /wp-content/plugins/woocommerce/templates/single-product/meta.php
    to a new folder in your theme

    /wp-content/themes/my-theme-name/woocommerce/single-product/meta.php

    Edit that file to exclude the categories, which should be lines 23 and 24.

    Woocommerce will use the file in your theme instead of the template file in the plugin.

  3. Netflora
    Member
    Posted 1 year ago #

    Ok cool, I'll give that a go, cheers!

  4. Netflora
    Member
    Posted 1 year ago #

    Oh and if I break something I can just delete the new file from /wp-content/themes/my-theme-name/woocommerce/single-product/meta.php

    and it will revert to the original?

  5. danbodenstein
    Member
    Posted 1 year ago #

    Yes it will.

  6. Netflora
    Member
    Posted 1 year ago #

    Hi, I removed the following lines and uploaded the file to the new directory in my theme woocommerce/single-product/

    <?php
    		$size = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
    		echo $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $size, 'woocommerce' ) . ' ', '.</span>' );
    	?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

    But no go?

    Charlie

  7. Netflora
    Member
    Posted 1 year ago #

    Any ideas anyone?

  8. danbodenstein
    Member
    Posted 1 year ago #

    Add something to the file to "see" if its executing it.

    Make sure that the new template file is being seen.

  9. Netflora
    Member
    Posted 1 year ago #

    Could it be a cache issue?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic