0

I've tried the solution explaned here Display Woocommerce Product Category on cart and checkout page but this way all categories are displayed, I'm only interested in the parent category.

I used this code in checkout and cart foreach loop:

echo wc_get_product_category_list( $cart_item['product_id'] );

For example: I have these cat and sub cat

- MARIA
-- SEDIE
-- TAVOLI
- GIOVANNI
-- SEDIE
-- TAVOLI

If I use the code above, I will see the list of selected categories and subcategories; what I would like is to display only the parent categories (MARIA or GIOVANNI)

Thanks for support

ASdsgnr
  • 1
  • 1
  • Can you explaing in details so we can help as soon as possible. – Savan Dholu Dec 01 '21 at 05:54
  • Sure, for example I have these cat and sub cat: - MARIA -- SEDIE -- TAVOLI - GIOVANNI -- SEDIE -- TAVOLI If I use the code above, I will see the list of selected categories and subcategories; what I would like is to display only the parent categories (MARIA or GIOVANNI) – ASdsgnr Dec 02 '21 at 09:17

0 Answers0