I’d like to use the published field on products that’s documented here in the Shopify API:
Hide a published product by changing the published attribute to false
I can change the flag on any product, but I have not figured out yet how to get the published field back from the API. It’s not listed the list of fields of the Product
object.
You can set the
published_atfield of individual products directly as described here:You can also hide a collection of products by setting
publishedto false as described here:UPDATED
Now that I understand the question better, here is the answer you want. You can’t really get the ‘published’ value back as there isn’t really a
publishedattribute on a product. You can, however, check thepublished_atfield and check if it’snil(not published). Settingpublished = falseapparently sets this to nil for you.