WordPress.org

Forums

WooCommerce - excelling eCommerce
[resolved] Need Category on cart page (4 posts)

  1. dhaval_jani
    Member
    Posted 1 year ago #

    Hi there,

    Can anyone please let me know how can i get the product category along with product name on the cart page?

    This is how I need and modify :

    <tr>
    <th class="product-remove"> </th>
    <th class="product-thumbnail"> </th>
    <th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>

    ******This is the update that i need on cart page********
    <th class="product-cat"><?php _e( 'Category', 'woocommerce' ); ?></th>

    <th class="product-price"><?php _e( 'Price', 'woocommerce' ); ?></th>
    <th class="product-quantity"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
    <th class="product-subtotal"><?php _e( 'Total', 'woocommerce' ); ?></th>
    </tr>

    Thanks a lot

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

  2. IgniteWoo Team
    Member
    Posted 1 year ago #

    You get product categories the same as regular WP posts categories, except it's a custom taxonomy called product_cat, so you'd use that name along with the product ID number.

    http://codex.wordpress.org/Function_Reference/wp_get_post_terms

  3. dhaval_jani
    Member
    Posted 1 year ago #

    Thanks a lot mate. Did get my solution. Have modified and used code from single-product.php and it did worked fine

    Cheers

  4. dhaval_jani
    Member
    Posted 1 year ago #

    Closing the topic now.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic