How to exclude products with price 0 from Search Results?

Highlighted
New Member
1 0 0

I really need to exclude all products with the price ZERO from Search Results Page. How to do this? Below, a part of code from my search-template.liquid 

 

{%- paginate search.results by per_page -%}
<div id="sandbox">
<div class="product-list products">
{%- for product in search.results -%}
{%- if product.object_type != 'article' and product.object_type != 'page' -%}
{%- include 'product-item2' -%}
{%- else -%}
{%- include 'item2-search' -%}
{%- endif -%}
{%- endfor -%}
</div>
{%- if settings.ctemplate_type == "promo" -%}
<div class="product-grid products">
<div class="row">
{%- for product in search.results -%}
<div class="col-sm-4 col-xs-6 product-item">
{%- if product.object_type != 'article' and product.object_type != 'page' -%}
{%- include 'product-item' -%}
{%- else -%}
{%- include 'item-search' -%}
{%- endif -%}
</div>
{%- endfor -%}
</div>
</div>
{%- else -%}
{%- assign grid_row = settings.collection_product_per_pow2 | plus:0 -%}
{%- assign grid_class = 3 -%}
{%- if settings.collection_product_per_pow2 == '6' -%}{%- assign grid_class = 2 -%}{%- elsif settings.collection_product_per_pow2 == '5' -%}{%- assign grid_class = 25 -%}{%- elsif settings.collection_product_per_pow2 == '3' -%}{%- assign grid_class = 4 -%}{%- endif -%}
<div class="product-grid products">
<div class="row">
{%- assign row_fluid = 0 -%}
{%- for product in search.results -%}
<div class="col-sm-{{grid_class}} col-xs-6 product-item">
{%- if product.object_type != 'article' and product.object_type != 'page' -%}
{%- include 'product-item' -%}
{%- else -%}
{%- include 'item-search' -%}
{%- endif -%}
</div>
{%- endfor -%}
</div>
</div>
{%- endif -%}
</div>
{%- case settings.shop_pagination -%}
{%- when '1' -%}
<div class="fastor_ajax_load_button fastor_ajax_load_more_btn animated fadeIn">
<a class="button" href="#" data-processing="0" data-loading-items="{{ 'general.pagination.loading_items' | t | escape }}" data-no-more="{{ 'general.pagination.no_more' | t | escape }}">
{{- 'general.pagination.load_more' | t | escape -}}
</a>
</div>
{%- include 'pagination' -%}
{%- when '2' -%}
<div class="fastor_ajax_load_button fastor_ajax_load_more_hidden animated fadeIn">
<a class="button" href="#" data-processing="0" data-loading-items="{{ 'general.pagination.loading_items' | t | escape }}" data-no-more="{{ 'general.pagination.no_more' | t | escape }}">
<i class="icon-px-outline-load"></i>
&nbsp;&nbsp;{{- 'general.pagination.load_more' | t | escape -}}
</a>
</div>
{%- include 'pagination' -%}
{%- else -%}
{%- include 'pagination' -%}
{%- endcase -%}
{%- include 'spinner' -%}
{%- endpaginate -%}
{%- else -%}
<p class="empty">{{'search.general.no_products' | t}}</p>
{%- endif -%}
</div>
</div>
</div>

0 Likes