FROM CACHE - en_header

Cannot add products to cart.

janine-anbinder
Tourist
10 3 1

Hi Everyone, 

I have tried to add the Payment plan to my store, but since i'm not an expert i think that i might have messed something up with the coding and now customers wont be able to add products to their carts. Any advice on hoe to fix this?

www.jewnana.com

Thanks in advance, 

Janine.

Replies 2 (2)
Michal17
Shopify Partner
835 73 158

HHi @janine-anbinder 

Hope you're having a great day!

The product-form file contains an error on line 2. What could have caused this error? Have you recently tried to modify one of the files on your site?

scrnli_05_06_2021_19-58-53.png

One of your files contains an error. What could have caused this error? Have you recently tried modifying one of the source code files on your website? Have you installed any applications recently?

I will be able to help you more if you can share the contents of the product-form.liquid and new-comment.liquid files. You will probably find the files in the sections or snippets folders.

You can find the affected files by following the following steps:

scrnli_31_05_2021_14-18-18.png

If you have any further questions, please do reach out either here on the forum, or via a private message/email. If you found this comment useful then please hit Like and Accept the Solution!

janine-anbinder
Tourist
10 3 1

Thank you so much for your help, and yes, i've tried to modify one of the files, here is a copy of the file...  Please let me know what can i do to fix it.... 

{% form 'product', product, data-product-form:product_form_config
{{ form | payment_terms }}
{% endform %}
<script class="product-json" type="application/json">
{{ product | json }}
</script>

<!-- collection breadcrumbs -->
{% if collection %}
<div class="desktop-1 right mobile-hide">
{% if collection.previous_product %}
{{ '<i class="fa fa-angle-left" aria-hidden="true"></i>' | link_to: collection.previous_product }}
{% endif %}
&nbsp;
{% if collection.next_product %}
{{ '<i class="fa fa-angle-right" aria-hidden="true"></i>' | link_to: collection.next_product }}
{% endif%}
</div>
{% endif %}

<div class="product-description">

{% if section.settings.show_vendor %}
<h3>{{ 'products.product.designer' | t }}: {{ product.vendor }}</h3>
<div class="clear"></div>
{% endif %}

{%- if settings.show_multiple_currencies -%}
{% assign price = current_variant.price | money_with_currency %}
{% assign compare_price = current_variant.compare_at_price | money_with_currency %}
{%- else -%}
{% assign price = current_variant.price | money %}
{% assign compare_price = current_variant.compare_at_price | money %}
{%- endif -%}
{%- if current_variant.compare_at_price > current_variant.price -%}
{% assign onsale = true %}
{%- endif -%}
<div id="product-price">
<span class="product-price" itemprop="price">
<span class="{% if onsale %}onsale{% endif %} money">{{ price }}</span>
</span>
{% if onsale %}
<span class="was">
<span class="money">{{ compare_price }}</span>
</span>
{% else %}
<span class="was"></span>
{% endif %}
</div><div class="clear"></div>

{% if section.settings.product_note != blank %}
<p class="product-note">
{{ section.settings.product_note | escape }}
</p><div class="clear"></div>
{% endif %}

{% if product.options.size > 1 %}
<div class="select" {% if product.variants.size == 1 %}style="display: none;"{% endif %}>
<select id="product-select-{{ product.id }}" name='id'>
{% for variant in product.variants %}
<option value="{{ variant.id }}" {% if variant == current_variant %}selected="selected"{% endif %}>
{{ variant.title }} - {{ variant.price | money }}
</option>
{% endfor %}
</select>
</div>
{% elsif product.options.size == 1 and product.variants.size > 1 %}
<div class="select">
<label>{{ product.options[0] }}</label>
<select id="product-select-{{ product.id }}" name='id'>
{% for variant in product.variants %}
<option data-sku="{{ variant.sku }}" value="{{ variant.id }}" {% if variant == current_variant %}selected="selected"{% endif %}>
{{ variant.title }} - {{ variant.price | money }}
</option>
{% endfor %}
</select>
</div>
{% elsif product.variants.size == 1 %}
<select id="product-select-{{ product.id }}" name="id" {% if product.variants.size == 1 %}style="display: none;"{% endif %}>
{% for variant in product.variants %}
<option value="{{ variant.id }}" {% if variant == current_variant %}selected="selected"{% endif %}>
{{ variant.title }} - {{ variant.price | money }}
</option>
{% endfor %}
</select>
{% else %}
<div class="what-is-it">
{% if product.options.first != 'Title' %}
<label>{{ product.options.first }}:</label>
{% for variant in product.variants %}
<span class="it-is">{{ variant.option1 | escape }}</span>
{% endfor %}
{% endif %}
</div>
<div class="product-variants"></div><!-- product variants -->
<input type="hidden" id="{{ variant.id }}" name="id" data-sku="{{ variant.sku }}" value="{{ product.variants[0].id }}" />
{% endif %}

{% if section.settings.show_sku %}
<div class="sku">
<label style="display: inline-block; line-height: 1.6em;">{{ 'customer.order.details.sku' | t }}:</label> <span class="variant_sku">{{ current_variant.sku }}</span>
</div><div class="clear"></div>
{% endif %}

{%- if section.settings.show_quantity_selector -%}
<div class="product-qty selector-wrapper">
<label for="quantity">{{ 'products.product.quantity' | t }}</label>
<input min="1" type="number" class="quantity" name="quantity" value="1" />
</div>
{%- endif -%}

{% if current_variant.available %}
<div class="product-add">
<input id="AddToCart" type="submit" name="button" class="add{% if section.settings.show_payment_button %} secondary-button{% endif %}" value="{{ 'products.product.add_to_cart' | t }}" />
</div>
{% else %}
<div class="product-add">
<input id="AddToCart" type="submit" name="button" class="add{% if section.settings.show_payment_button %} secondary-button{% endif %}" value="{{ 'products.product.sold_out' | t }}" />
</div>
{% endif %}

{% capture the_snippet_fave %}{% render 'socialshopwave-widget-fave' %}{% endcapture %}
{% unless the_snippet_fave contains 'Liquid error' %}
{{ the_snippet_fave }}
{% endunless %}

{% if section.settings.show_payment_button %}
{{ form | payment_button }}
{% endif%}

</div>

{% endform%}