Hi guys,
I’m creating a theme app extension (App block) to show custom text on the collection page. I am trying with the Dawn theme.
In the snippet file /snippets/card-product.liquid I have some code like this
{% render 'price', product: card_product, price_class: '' %} // card_product is Product liquid object
// Below is my additional code
{% for block in blocks %}
{% case block.type %}
{% when '@app' %}
{% render block, product_item: card_product %}
{% endcase %}
{% endfor %}
I want to pass the Product liquid object (card_product) to my app block and named it product_item.
Now, I call product_item in theme-app-extension\blocks\app-block.liquid
<div
data-id="{{ block.id }}"
style="font-size: {{ block.settings.text_size }}px;">
<div data-product-price="{{ product_item.price | money_without_currency }}">
Split your payment & pay
<span >{{ product_item.price | money_without_currency }}</span>
today
</div>
When I push the extension to Shopify, it hits error
Undefined object
product_itemat blocks/app-block.liquid:
I don’t know what I missed. Please help me on this. Thanks