troubleshooting Question

Trying to append content to Short Description in WooCommerce

Avatar of Alicia St Rose
Alicia St RoseFlag for United States of America asked on
* woo commercePHPWordPress
11 Comments2 Solutions113 ViewsLast Modified:
Hello!

I'm trying to add some content to the short description in the single product view. I've created a div that contains Post Objects from an Advanced Custom Fields Post Object field.

I've got the code below, but instead of appending, it's actually replacing. I can see why, but I can't figure out how to bring back the summary in the code.

<?php add_filter('woocommerce_short_description','ts_add_text_short_descr');
function ts_add_text_short_descr($description){
	$post_objects = get_field( 'juices_included_in_the_cleanse' );
			if ( $post_objects ): ?>
				<div class="cleanse-juices">
					<ul>
			
			 
				<?php foreach ( $post_objects as $post ):  ?>
					<?php setup_postdata( $post ); ?>
					<li>
						<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
					</li>
				<?php endforeach; ?>
				<?php wp_reset_postdata(); ?>
			 </ul>
			<?php endif; ?>
		</div>
	</div>
  
<?php }
?>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros