WordPress   

Get list of all registered product attributes in Woocommerce

// Get all registered product attributes in Woocommerce
foreach(wc_get_attribute_taxonomies() as $attribs){
	$attributes = get_terms(array('taxonomy'=>'pa_' .$attribs->attribute_name,'hide_empty'=>false,'fields'=> 'all')); ?>
	<div class="attributes">
	<h3><?php echo $attribs->attribute_label; ?></h3>
	<ul class="attribute-list">
	<?php if(!empty($attributes)):
	foreach($attributes as $attribute): ?>
		<li data-value="<?php echo $attribute->taxonomy.'__'.$attribute->slug; ?>">
		<?php echo $attribute->name; ?>
		</li>
	<?php endforeach; endif; ?>
	</ul>
	</div>	
<?php }
Need Professional Support for Your Website Problems?

Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.

Hire Us

Got an idea? We'll turn it into reality.

Tell us what you're building, what's broken, or what numbers need to move. We'll come back within one business day with a short plan — no long decks, no sales calls without purpose.

Response time: First reply within 1 business day on 100% of messages.
Transparent scope: Fixed proposals with weekly check-ins & live task tracking.
Ship-ready builds: Every engagement leaves behind documented, transferable work.
Long-term partners: Ongoing retainers for support, SEO, ads, and content.