216 votes
0 answers
Shopify liquid - collection object is empty in theme.liquid
Solution:
Yescollection
objetc is empty when you're in the product page. What collection do you need?
If you need any collection that contains the current product you can do
{% assign collection = product.collections.first %}
And then you will have the collection assigned to thecollection
variable.
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.