How do i call tags as an array ?

Johann-Davel
Tourist
7 0 0

i call the title like this

this.props.product.title

but how do i call the tags ?

0 Likes
Pallavi
Shopify Expert
792 104 116
Hello There,
Check this all article and code than implement
{%- assign tag_groups = "size,color,weight,category" | split: "," -%}
{%- assign sorted_tags = "" -%}
{%- for group in tag_groups -%}
  {% for tag in product.tags %}
    {%- assign tag_group = tag | split: "_" | first -%}
    {%- if tag_group == group -%}
      {%- assign sorted_tags = sorted_tags | append: tag | append: "," -%}
    {%- endif -%}
  {% endfor %}
{%- endfor -%}
{%- assign sorted_tags_arr = sorted_tags | remove_last: "," | split: "," -%}
 
{%- for tag in sorted_tags_arr -%}
  {{- tag -}}<br>
{%- endfor -%}
.........................................................................
<div class="product-single_tags">
<ul class="product-tags">
{% for tag in product.tags %}
<li>{{ tag }}</li>
{% endfor %}
</ul>
</div>
......................................................................
Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
0 Likes
Johann-Davel
Tourist
7 0 0

Oh i actually meant with buy sdk in a custom app, But i since found out you can only do it in unofficial. i since moved to building the site in shopify. Its a pitty the buy sdk doesnt give all the data.

0 Likes