Hello,
Overview:
In mobile view, when adding Product one to the cart, it shows product two instead. This only happens in mobile view.
I noticed in the code, It shows the incorrect variant ID in mobile view and the correct in Desktop view. There are two in the code below
PRODUCT FORMS
{%- endcomment -%}
{% if forloop.first %}
{% for block in blocks %}
{% assign _data = block.settings %}
{% assign _product = all_products[_data.product] %}
{% assign _variant = _product.selected_or_first_available_variant %}
{{ _product.price | money }}
{{ _variant.options[0] }} {{ _data.price_per_can }}
{{ section.settings.preorder_note }}
<button
type=“button”
class=“p-[14px]”
@Click =“quantity++”
<button
class=“btn block w-full group relative”
type=“submit”
@Click .prevent=“$store.cart.add([{ id: {{ _variant.id }}, quantity } ])”
{% endfor %}
{% else %}
{{ product.price | money }}
{{ variant.options[0] }} {{ data.price_per_can }}
{{ section.settings.preorder_note }}
<button
type=“button”
class=“p-[14px]”
@Click =“quantity++”
{{ product.price | money }}
<button
class=“btn block w-full group relative”
type=“submit”
@Click .prevent=“$store.cart.add([{ id: {{ _variant.id }}, quantity } ])”
{% endif %}
Your help is appreciated.
Best,
Randy