11 posts
  • 5 Years of Membership
  • Collector Level 2
  • Exclusive Author
  • Netherlands
WMTD
says

Hi,

On my shop category pages and product page I would like to display what sizes we have available for each product. So let’s say I have 5 sizes: small, med, large, xl, xxl…

IF the product has all those sizes available I wanna say “5 sizes available” or “available in s, m, etc”.

IF the product only has m, l, xl available I wanna say “3 sizes available” or “available in m, l, xl”..

Can anybody point me in the right direction?

With <?php $subheadingvalues = get_the_terms( $product->id, 'pa_size'); foreach ( $subheadingvalues as $subheadingvalue ) { echo $subheadingvalue->name; } ?> I have been able to output all sizes that exist, but I wanna hide those that have no stock on said product…
135 posts
  • Most Wanted Winner
  • Trendsetter
  • Weekly Top Seller
  • Author Level 6
+5 more
WPShowCase
says

It looks like you need to use variable products :-).

by
by
by
by
by
by