Retrieving the product published field
{% if product_entity.status.value == 0 %}
  {%
    set classes = [
    'is-unpublished'
    ]
  %}
{% endif %}
&lt;article{{ attributes.addClass(classes) }}&gt;
..
&lt;/article&gt;