weby82
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Show parent category name in archive product listyou’re welcome.
thks !
Forum: Plugins
In reply to: [WooCommerce] Show parent category name in archive product listOk, I searched everywhere and by recovering pieces of code I was able to make a hook adapted to my Flatsome theme. But I think the part to recover the parent can be useful to others.
function flatsome_woocommerce_shop_custom_category() { if ( ! flatsome_option( 'product_box_category' ) ) { return; } ?> <p class="category uppercase is-smaller no-text-overflow product-cat op-7"> <?php global $product; $curr_cat = get_queried_object(); if($curr_cat->parent > 0): $parentcats = get_ancestors($curr_cat->term_id, 'product_cat'); foreach($parentcats as $parent): $cat = get_term($parent,'product_cat'); $cat_name = $cat->name; endforeach; else: $cat_name = $curr_cat->name; endif; echo $cat_name; ?> </p> <?php } // I cancel the addition of the category of the woocomerce function of the parent theme add_action( 'woocommerce_init', function(){ remove_action( 'woocommerce_shop_loop_item_title', 'flatsome_woocommerce_shop_loop_category', 0 ); } ); // I add my function instead add_action( 'woocommerce_shop_loop_item_title', 'flatsome_woocommerce_shop_custom_category', 0 ); ?>
Forum: Plugins
In reply to: [WooCommerce] Show parent category name in archive product listNo. just in product list, i need to display parent product category name for each product instead of child category name.
Forum: Plugins
In reply to: [WooCommerce] Show parent category name in archive product listHello @roxannestoltz
I do not have link, my website is on local.
But in product list, in shop, i have the name of category displaying in product box with price and product name. But for one product, for exemple, i have the categories “mower”, child category “thermal mower” and potentially the category “Special offer”. And now, in product list i have the category “Special offer” which appears or “thermal mower”. But I want to show only the parent category “Mower”.Forum: Plugins
In reply to: [WooCommerce] Show parent category name in archive product listok ! thks !
Forum: Plugins
In reply to: [Colissimo Delivery Integration] Lien etiquette aller non visibleBonjour,
Oui je m’en suis rendu compte tout à l’heure, désolé. Mais je n’ai pas trouvé comment supprimer le message.