Display all the subcategories from a specific category?

Try something like this: by ID function woocommerce_subcats_from_parentcat_by_ID($parent_cat_ID) { $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $parent_cat_ID, ‘taxonomy’ => ‘product_cat’ ); $subcats = get_categories($args); echo ‘<ul class=”wooc_sclist”>’; foreach ($subcats as $sc) { $link = get_term_link( $sc->slug, $sc->taxonomy ); echo ‘<li><a href=”‘. $link .'”>’.$sc->name.'</a></li>’; } echo ‘</ul>’; } by … Read more

Woocommerce get cart total price in a number format [closed]

Update 2020 Answer See flytech’s answer for a solution using the native WooCommerce API. Note / Caveat If you’re going to do proper arithmetic with monetary values, always use signed integers (!) representing the smallest denomination of a given currency (Cent, Penny, Paisa, Dirham, e.g.). Only convert back to decimal fractions in the presentation layer … Read more

Order get_terms by term meta

get_terms supports a meta_query which calls a new WP_Meta_Query parameter as you can see here. To query your terms with your desired meta, you could change your function call to something like this: $args = array( ‘taxonomy’ => ‘categoria-de-productos’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘hide_empty’ => false, ‘hierarchical’ => false, ‘parent’ => 0, ‘meta_query’ … Read more