11 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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…
125 posts
  • Has sold $10,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Joined an Envato Football competition
  • Has referred 1+ members
+3 more
WPShowCase says

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

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by