Liquid syntax error Expected end_of_string but found id in "p != "" or fp contains "

Topic summary

A Shopify store owner encountered a Liquid syntax error when loading product descriptions: “Expected end_of_string but found id in ‘p != “” or fp contains "’” on line 44 of sections/product-square.liquid.

Key Details:

  • The store was working fine before this error suddenly appeared
  • The provided code snippet shows product image gallery logic, but appears corrupted with reversed/garbled text in several sections
  • The actual error originates from line 44 in the product-square.liquid file

Suggested Troubleshooting:

  • Review the code around line 44 in sections/product-square.liquid, particularly any conditional statements
  • The error likely involves an improperly formatted “if” statement or string containing an unexpected “id” keyword
  • Try commenting out sections of code to isolate where the syntax error occurs
  • The garbled/reversed text in the provided code suggests possible file corruption

Status: Unresolved - awaiting further investigation of the actual line 44 code

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

Hi guys,

My Shopify store was working fine and suddenly I see this error when it tries to load productoin description:

Liquid syntax error (sections/product-square.liquid line 44): Expected end_of_string but found id in "p != “” or fp contains "

Below is the file code and I have also attached the screenshot

{% if product.images.size > 0 %}

{% for image in product.images %}
{%- if _zoom -%}
{%- endif -%} {% include 'image-style' with image_class: 'image-zoom', image_size: '2048x2048' %} {%- if _zoom -%}
{%- endif -%}
{% endfor %}
{% for image in product.images %}
{% include 'image-style' with image_size: '320x' %}
{% endfor %}
{% else %} {{ 'image' | placeholder_svg_tag: 'placeholder-svg' }} {% endif %}

Hello there

It seems that the error is in another file that this code is including. Specifically, the error is in the “sections/product-square.liquid” file on line 44. The error message is indicating that there is an error in the Liquid syntax and it was expecting an end_of_string but instead found an “id” in the code.

Without seeing the code in the “sections/product-square.liquid” file, it’s difficult to say what the issue is, but it seems like there might be a problem with an “if” statement. It looks like there might be an “id” keyword that’s causing the issue, but it’s difficult to say for sure without seeing the rest of the code.

I would suggest reviewing the code in the “sections/product-square.liquid” file, particularly around line 44, to see if you can identify the issue. If you’re still having trouble, you could try commenting out that section of code to see if the error goes away, and then slowly uncommenting it to identify where the issue is.