Support » Plugin: WooCommerce PDF Invoices & Packing Slips » category near product description

  • Resolved lumie

    (@lumie)


    I would like to insert category and subcategory near description in my invoice.

    How made it ?

    Thank

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support kluver

    (@kluver)

    Hi @lumie,

    That is certainly possible with an action hook: Print a list of product categories

    If you haven’t worked with action hooks or functions.php before I would advise you to also read this: How to use filters

    With kind regards,

    Michael

    Thank you, i have tried and it work.

    Now i would like to see the principal category besides the subcategory. How i made ?

    Thank for you reply.

    Plugin Author Ewout

    (@pomegranate)

    Hi! Unfortunately that is vastly more difficult and would require additional custom coding. The wc_get_product_category_list function that is used in this example snippet is simply calling the WordPress function get_the_term_list. If you want to add the main category to the subcategory you will need to either call get_the_terms( $item['product']->get_id(), 'product_cat' ) and then parse the results yourself, or filter the return value of get_the_term_list using the term_links-product_cat filter. Definitely not beginners stuff though, unfortunately… Good luck!

    Ewout

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘category near product description’ is closed to new replies.