Cannot get results for customer search terms

KIE
New Member
2 0 0

After changing the shopify design from an existing template to one developed in-house,

we'll be able to I cannot get the correct search history.

Our language is Japanese and our customers are 99% Japanese.

Before the change, all the data about what words customers were searching for was captured

and displayed on the dashboard. It used to be displayed,

but now it only shows the English search data.

The total number of searches is also 1/100th of what it was before the renewal,

which is clearly an error. I'll leave the code after the change, so please let me know if you have any advice.

{% paginate search.results by 10000 %}<div class="inner">
<form action="/search" method="get" role="search" class="search-form">
<input type="search" name="q" value="{{ search.terms | escape }}" class="search-form__input" />
<button type="submit" class="search-form__btn">
<i class="search-form__icon fas fa-search"></i>
</button>
</form> {% if search.performed %}
{% assign products = search.results | where: "object_type", "product" %}
{% assign articles = search.results | where: "object_type", "article" %}
<div class="search-tabs fl-space-between">
{% if products.size == 0 and articles.size == 0 %} <!-- 商品0 かつ 記事0 -->
<div class="search-tab item-tab js-search-tab js-active">商品</div>
<div class="search-tab article-tab js-search-tab">記事</div>
{% elsif products.size == 0 and articles.size > 0 %} <!-- 商品0 かつ 記事あり -->
<div class="search-tab item-tab js-search-tab">商品</div>
<div class="search-tab article-tab js-search-tab js-active">記事</div>
{% else %}<!-- それ以外 -->
<div class="search-tab item-tab js-search-tab js-active">商品</div>
<div class="search-tab article-tab js-search-tab">記事</div>
{% endif %}
</div> <!-- 検索結果の中から商品のみを取得 -->
{% assign var_count = 0 %}
{% for p in products %}
{% for v in p.variants %}
{% assign var_count = var_count | plus: 1 %}
{% endfor %}
{% endfor %} <div class="search-items-wrapper">
<p class="search-number">検索結果:{{ var_count }}件</p>
<section class="section">
<div class="grid-container">
{% if products.size > 0 %}
{% for item in products %}
{% for variant in item.variants %}
{% if variant.title contains 'Default' %}
{% assign variant_image = item.featured_image %}
{% assign variant_title = '' %}
{% else %}
{% assign variant_image = variant.image.src %}
{% assign variant_title = variant.title %}
{% endif %}
<div class="grid__item">
<a href="{{ variant.url | within: collection }}" title="{{ variant.title | escape }}" class="card">
{% unless variant.available %}
<span class="card__label card__label--soldout">Sold out</span>
{% endunless %}
<img src="{{ variant_image | img_url: '1000x' }}" alt="" class="card__img"/>
<p class="card__tag">{{ item.vendor }}</p>
<h4 class="card__title">{{ item.title }}</h4>
<p class="card__sku">{{ variant_title }}</p>
<p class="card__price">{{ variant.price | money }}</p>
</a>
</div>
{% endfor %}
{% endfor %}
{% else %}
<p class="no-result-text grid__item grid__col-cover">お探しの商品はありませんでした。</p>
{% endif %}
</div>
</section> {% section 'search' %} </div> <!-- 検索結果の中から記事のみを取得 -->
<div class="search-articles-wrapper">
<p class="search-number">検索結果:{{articles.size}}件</p>
<section class="section">
<div class="grid-container grid-container--horizontal"> {% if articles.size > 0 %}
{% for item in articles %}
<div class="grid__item grid__col-cover card--horizontal__wrapper">
<a href="{{ item.url | within: collection }}" title="{{ item.title | escape }}" class="card card--horizontal">
<img src="{{ item.image.src | img_url: '1000x' }}"
alt="{{ item.featured_image.alt | escape }}"
class="card__img card--horizontal__img"
/>
<div class="card--horizontal__body">
<h4 class="card__title">{{ item.title | truncate: 80, '...'}}</h4>
<p class="card__date">{{ item.created_at | date: "%Y.%m.%d" }}</p>
</div>
</a>
</div>
{% endfor %}
{% else %}
<p class="no-result-text grid__item grid__col-cover">お探しの記事はありませんでした。</p>
{% endif %}
</div>
</section> {% section 'recomment-magazine' %} </div> {% else %}
<p class="no-result-text no-result-text--firstview grid__item grid__col-cover">商品や記事を検索できます。</p>
{% endif %} {% if paginate.pages > 1 %}
{{ paginate | default_pagination }}
{% endif %} {% endpaginate %}
</div>
 
0 Likes