Quantity Selector Not Carrying Over To Cart Page

Hello Shopify Community,

I am hoping someone might be able to help with this issue. Using the Mr. Parker Shopify Theme.

We have added the quantity selector and Add To Cart sections on the Collection pages, but I am having trouble getting the quantity selector to carry over the quantity amount to the cart page.

I copied the quantity selector section over from the product page, but seems I am missing something.

Here is the code that is currently on the Collection page for the form section:

{% assign call_to_action = ‘products.product.add_to_cart’ | t %}
{% form ‘product’, product, id: “AddToCartForm”, class: “product_form”, data-product-form:product_form_config, data-product-id: product.id %}
{% render ‘product-json’, product: product, section_id: section.id %}

{% if product.options.size > 1 %}

{% elsif product.options.size == 1 and product.variants.size > 1 %}
{{ product.options[0] }}
{% if section.settings.product_variants == 'swatches' %} {% for option in product.options_with_values %} {% render 'swatch', option: option, product: product, color_swatch_style: section.settings.color_swatch_options, current_variant: current_variant %} {% endfor %} {% endif %} {% else %}
{% if product.options.first != 'Title' %} {{ product.options.first }}: {% for variant in product.variants %} {{ variant.option1 | escape }} {% endfor %} {% endif %}
{% endif %}

{% if section.settings.show_sku %}

{{ 'customer.order.details.sku' | t }}: {{ current_variant.sku }}
{% endif %}
{% if section.settings.show_quantity %} {{ 'products.product.quantity' | t }} {% endif %} {% if section.settings.show_payment_button %} {{ form | payment_button }} {% endif %}

{% endform %}

Any help would greatly be appreciated.

Thanks in advance,

Todd

I was wondering if anyone had any solutions? Or can direct me to a similar issue where it was resolved?

This is a bit frustrating and was hoping that somebody could help before I reach out to a professional developer.

Thanks,

Todd

I don’t quite understand. You want a quantity selector on the cart page? Or you just want the quantity of the line items displayed with their item on the cart page. I’m not familiar with the theme, but I assume that would be default behavior. Can you post a link to your store and a screenshot of what you’d like?

Hi Ninthony,

Thanks for jumping in. Basically, we have added the Quantity and Add To Cart form on the Collections page. This will be a Wholesale website and many of our vendors do not need to read about the product as they are very familiar with them already.

The issue is, when you add a quantity to the box, like 5 or 6, that amount does not carry over to the Cart page. The Cart page only shows “1”.

So, yes, we just want the quantity of the line items displayed with their item on the cart page. I have included a screenshot.

The site is not active yet, here is a link: https://swahili-wholesale.myshopify.com. Password: bluvah

I think it’s simple fairly simple, but I am not able to get it to work properly.

Thanks again,

Todd

1 Like

So wherever you added that HTML, go to the input element that is your quantity. It’s name is set to “updates”, that is incorrect. Just change the name to be “quantity”:


//change that to this:

Hi Ninthony,

Thank you for your help. I have made the changes and the same results though. This is what I currently have now in that section:

{% if section.settings.show_quantity %}
{{ ‘products.product.quantity’ | t }}

{% endif %}
<input type=“submit” name=“button” class=“add clearfix AddtoCart{% if section.settings.show_payment_button %} secondary-button{% endif %}” value=“{{ call_to_action }}” {% unless current_variant.available %}disabled{% endunless %} />
{% if section.settings.show_payment_button %}
{{ form | payment_button }}
{% endif %}

{% endform %}

Maybe I missed something?

Again, any further help would be very much appreciated.

Just change it to:


Get rid of the “[{{ item.id }}]” portion in the name and you should be good. I just changed it to quantity and added 8 of one of your products to the cart and it carried over.

Hi Again Ninthony,

That worked! Thanks so much for your help, I really appreciate it.

I am learning, slowly, Shopify liquid code, but not quite there yet, so thank you very much again!

Let’s mark this one resolved!

You marked your own post as the solution lol ~_^ – that’s fine though. I’m glad it helped. Have a good one.

I hit the wrong Accepted Solution and have added it to your replay with the code. Thanks again.