Support

Account

Home Forums Front-end Issues Repeater inside product category (woocommerce)

Solved

Repeater inside product category (woocommerce)

  • I am currently using ACF 5. I have set up a repeater on the product categories.

    I’m currently struggling with how to get it to output the information. I am inside the acrhive-product loop and I am updating the following template that contains the content that gets outputting:

    <?php while ( have_posts() ) : the_post(); ?>
    
    	<?php wc_get_template_part( 'content', 'product_cat' ); ?>
    
    <?php endwhile; // end of the loop. ?>

    In content-product_cat.php I have the following for each loop for the repeater. All the basic information already shows, the title, the woocommerce category image etc. Its the repeater I added to the categories themselves I can’t get to show.

    <?php
    	$terms = get_field('attributes', 'product_cat_'.$term->term_id); 
    	if($terms): ?>
    		<ul>
    	<?php foreach( $terms as $term ): ?>
                <li>
                 <?php the_sub_field('attribute'); ?>
                </li>
    	<?php endforeach; ?>
    		</ul>
          <?php endif; ?>	

    Any thoughts would be greatly appreciated

  • Hi,
    Here is an almost similar thread on how to access acf field from the product category page.

    http://support.advancedcustomfields.com/forums/topic/custom-wysiwyg-field-in-woocommerce-product-category/

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Repeater inside product category (woocommerce)’ is closed to new replies.