I have two different product recommendation arrays. One is the the provided recommendations.products variable and the other is a metafield defined collection of products product.metafields.product_alternates.related_hardware.value. I have the following code:
{%- comment -%}
Pull any manually defined related products as well as any auto generated products:
{%- endcomment -%}
{% assign related_products = product.metafields.product_alternates.related_hardware.value %}
{% if related_products != blank %}
{% assign related_products = related_products | concat: recommendations.products %}
{% else %}
{% assign related_products = recommendations.products %}
{% endif %}
However the resulting concat variable related_products only ever contains the metafield array’s contents (regardless of which is being appended to). My assumption as to what is going on here is that these are arrays of two different variable types and one array’s content is overriding the other rather than throwing some type of error. Does anyone know why the above code doesn’t work?