11 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • 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…
91 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Referred between 1 and 9 users
  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
  • Football Contest Participant/Runner-up
WPShowCase says

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

by
by
by
by
by
by