When searching for an item on my store I am confronted with the above code.
Thanks in advance for any help.
Sorry for facing this issue, it’s my pleasure to help us.
Welcome to the Shopify community!
and Thanks for your Good question. ![]()
Please share your site URL,
So I will check and provide a solution here.
Thankyou.
@Fabian_weldon
You are facing this issue because there is an operator in your product-grid-item snippet is unrecognised by shopify. I can fix this issue if you let me view code of your store.
it’s your vendor name doesn’t show can you please share code or add me on staff so i will quick fix
thanks for the response.
this is my entire product-grid-item.liquid:
{% comment %}
This snippet is used to showcase each product during the loop,
‘for product in collection.products’ in collection.liquid.
A liquid variable (grid_item_width) is set just before the this
snippet is included to change the size of the container.
Once the variable is set on a page, all future instances of this
snippet will use that width. Overwrite the variable to adjust this.
Example
{% endcomment %}
{% unless grid_item_width %}
{% assign grid_item_width = ‘large–one-third medium–one-half’ %}
{% endunless %}
{% unless width %}
{%- assign width = 310 -%}
{% endunless %}
{% unless height %}
{%- assign height = 415 -%}
{% endunless %}
{% assign on_sale = false %}
{% if product.compare_at_price > product.price %}
{% assign on_sale = true %}
{% endif %}
{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}
{%- assign variant = product.selected_or_first_available_variant -%}
{% capture img_id_class %}ProductImage-{{ product.featured_image.id }}{% endcapture %}
{% capture img_wrapper_id %}ProductImageWrapper-{{ product.featured_image.id }}{% endcapture %}
{%- assign img_url = product.featured_image | img_url: ‘1x1’ | replace: ‘1x1.', '{width}x.’ -%}
{{ 'products.product.sold_out_html' | t }}
{{ 'products.general.save_html' | t: saved_amount: saved_amount }}
{%- if product.price_varies == false and variant.available and variant.unit_price_measurement -%}
{%- capture unit_price_separator -%}
/ {{ ‘general.accessibility.unit_price_separator’ | t }}
{%- endcapture -%}
{%- capture unit_price_base_unit -%}
{%- if variant.unit_price_measurement.reference_value != 1 -%}
{{- variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ variant.unit_price_measurement.reference_unit }}
{%- endcapture -%}
{{ ‘products.general.unit_price’ | t }}
{{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}}
{%- endif -%}
{% if section.settings.product_vendor_enable %}
{{ product.vendor }}
{% endif %}can you use the code I provided to create a solution or do you need me to add you to my store?
{% comment %}
This snippet is used to showcase each product during the loop,
'for product in collection.products' in collection.liquid.
A liquid variable (grid_item_width) is set just before the this
snippet is included to change the size of the container.
Once the variable is set on a page, all future instances of this
snippet will use that width. Overwrite the variable to adjust this.
Example
- assign grid_item_width = 'large--one-quarter medium--one-half'
{% endcomment %}
{% unless grid_item_width %}
{% assign grid_item_width = 'large--one-third medium--one-half' %}
{% endunless %}
{% unless width %}
{%- assign width = 310 -%}
{% endunless %}
{% unless height %}
{%- assign height = 415 -%}
{% endunless %}
{% assign on_sale = false %}
{% if product.compare_at_price > product.price %}
{% assign on_sale = true %}
{% endif %}
{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}
{%- assign variant = product.selected_or_first_available_variant -%}
{% capture img_id_class %}ProductImage-{{ product.featured_image.id }}{% endcapture %}
{% capture img_wrapper_id %}ProductImageWrapper-{{ product.featured_image.id }}{% endcapture %}
{%- assign img_url = product.featured_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% if product.featured_image.src== blank %}
{% else %}
{% include 'image-style' with image: product.featured_image, small_style: true, width: width, height: height, wrapper_id: img_wrapper_id, img_id_class: img_id_class %}
{% endif %}
{% if sold_out %}
{{ 'products.product.sold_out_html' | t }}
{% elsif on_sale %}
{% capture saved_amount %}{{ product.compare_at_price | minus: product.price | money_without_trailing_zeros }}{% endcapture %}
{{ 'products.general.save_html' | t: saved_amount: saved_amount }}
{% endif %}
{{ product.title }}
{% comment %}Start automatically added Judge.me widget{% endcomment %}
{% render 'judgeme_widgets', widget_type: 'judgeme_preview_badge', concierge_install: true, product: product %}
{% comment %}End automatically added Judge.me widget{% endcomment %}
—
{{ product.compare_at_price | money_without_trailing_zeros }}
{{ product.price | money_without_trailing_zeros }}
{%- if product.price_varies == false and variant.available and variant.unit_price_measurement -%}
{%- capture unit_price_separator -%}
/ {{ 'general.accessibility.unit_price_separator' | t }}
{%- endcapture -%}
{%- capture unit_price_base_unit -%}
{%- if variant.unit_price_measurement.reference_value != 1 -%}
{{- variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ variant.unit_price_measurement.reference_unit }}
{%- endcapture -%}
{{ 'products.general.unit_price' | t }}
{{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}}
{%- endif -%}
{% if section.settings.product_vendor_enable %}
{{ product.vendor }}
{% endif %}
{% render 'banana-stand-product-list-container', product: product %}
Replace your code with below one
I am experiencing the same. Pls help. www.bohovinta.ph. First time to encounter after switching theme to Brooklyn.
@BVshopPH , add me in your store, i will fix it
How to add you?
@BVshopPH
go to shopify admin panel >settings > plan & permissions > staff accounts.
-then add below id in staff accounts and click save.
candisoft100@gmail.com
I have added you to a staff account.
Thanks for the help
@Fabian_weldon
what is your store name?
thank you
@Fabian_weldon
I fixed it. please check.
thankyou so much for the help. That has worked perfectly
Hi @pioneer100
I used the code you’ve provided and that removed the error message, however, I’d like to have the product image displayed too.
Any tips or advice please?
Cheers
i know this is old, but in case anyone comes looking for this, i just solved this same problem for me. in the snippets product-grid-item.liquid you need to change:
product.featured_image.src== blank
to
product.featured_image.src== blank
there needs to be a blank after the .src and before the ==. there were two instances where that needed to be fixed in my snippet, and that sorted it out.