Woocommerce List categories with Image thumbnail

Try this code: $taxonomyName = “product_cat”; $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; foreach ($parent_terms as $pterm) { echo ‘<li><a href=”‘ . get_term_link($pterm->name, $taxonomyName) . ‘”>’ . $pterm->name . ‘</a></li>’; $thumbnail_id = get_woocommerce_term_meta($pterm->term_id, ‘thumbnail_id’, true); $image = wp_get_attachment_url($thumbnail_id); echo “<img src=”{$image}” alt=”” width=”400″ height=”400″ />”; //Get the Child … Read more

How to Get WooCommerce Product Price

If you are looking for to update the cart item price. You can try: add_action( ‘woocommerce_cart_loaded_from_session’, array(‘update_cart_item_price’ ),10); public function update_cart_item_price( $cart_obj ) { // This is necessary for WC 3.0+ if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ){ return; } if( !WC()->session->__isset( “reload_checkout” )) { foreach ( $cart_obj->get_cart() as $key => $value ) … Read more

Show the parent taxonomy by creating shortcode in woocommerce?

The Shortcode to display products in “Fruits” category when user is on another page or archive… is: [products category=”fruits”] As far as I know there is no shortcode to display the parent category products without specifying the given category slug. For your 2nd example you will have to call it in your sub category “Pork” … Read more

How to show WooCommerce Categories on ‘shop’ page instead of products?

I found a workable solution. The WooCommerce default templates don’t support the setting to show categories on the Shop page. However using a shortcode with do_shortcode(), and a condition this can be achieved as follows: if (is_shop()) { echo do_shortcode(‘[product_categories hide_empty=”0″]’); } else { woocommerce_product_loop_start(); if ( wc_get_loop_prop( ‘total’ ) ) { while ( have_posts() … Read more