not a dev, just trying to hack something together. In our Shopify site, have some logic that tags new blogs articles in a specific blog with a an order.id. So this blog has posts with one order.id per post.
On customer record (account), I made a grid where I want to show all articles where article.tags matches customer.orders.
I made an array for all the customer's order ids, and trying to compare this array with the article.tags array and show only the articles where there are matches in the two arrays.
Please help!
This is on customers/account.liquid:
<div class="table-wrap">
<table class="full table--responsive">
<thead>
<tr>
<th>POST NAME</th>
</tr>
</thead>
<tbody>
{% assign myorders = '' %}
{% for order in customer.orders %}
{% capture myorders %}
{{ myorders }} {{ order.id }}
{% endcapture %}
{% endfor %}
{% for article in blogs.my-posts.articles %}
{% if article.tags contains myorders %}
<!--SHOW THE MATCHING ARTICLES HERE-->
<tr>
<td class="underline"><strong><a href="{{ article.url }}">{{ article.title | capitalize }}</a></strong></td>
<tr>
{% else %}
You have no posts.
{% endif %}
{% endfor %}
</tbody>
</table>
</div>