Forum Discussion
DavidO
4 months agoStrategist II
Hi elena14
I'm assuming the house properties catalog is assigned early on so the loop knows which catalog to loop through.
Otherwise this looks pretty good to me except I can't see where you are using the assigned user_prodcut_id? Should it be part of your IF statement rather than the custom attribute liquid so the code would look like this:
{% assign user_product_id = {{ custom_attribute.${user_product_id} }} %}
<!-- Loop through each row in the catalog -->
{% for row in house_properties %}
<!-- Loop through each item in the current row -->
{% for item in row %}
<!-- Check if the item name contains the user's custom attribute -->
{% if item.id == user_product_id %}
{{ item.name }}
{% endif %}
{% endfor %}
{% endfor %}
Related Content
- 2 months ago
- 9 months ago
- 7 months ago
- 5 months ago