Support

Account

Home Forums ACF PRO get value under woocommerce query Reply To: get value under woocommerce query

  • I’m not exactly sure what you mean by query.

    Looking at your code, displaying the fields from the category would look something like this.

    
    <?php
      $args = array(
        'number'     => $number,
        'orderby'    => 'title',
        'order'      => 'ASC',
        'hide_empty' => $hide_empty,
        'include'    => $ids
      );
      $product_categories = get_terms( 'product_cat', $args );
      $count = count($product_categories);
      if ( $count > 0 ){
        foreach ( $product_categories as $product_category ) {
          echo '<h4><a href="' . get_term_link( $product_category ) . '">' . $product_category->name . '</a></h4>';
          if (get_field('text_field_name') ){
            ?>
              <p><?php the_field('text_field_name'); ?></p>
            <?php
          }
          if (get_field('cat_thumbnail') ){
            ?>
              <img src="<?php the_field('cat_thumbnail'); ?>" />
            <?php
          }
        }
      }
    ?>