Cart Attribute Field Undefined

Hi,

Just tried adding some Cart Attributes into my website and when text is entered into the section I am met with the following message. ‘You can only add this item in increments of undefined’.

The code is within the form sections of the Main-Cart-Items.Liquid code page.

Does anyone know of a fix for this? Thanks.

Hi, @Daniel_ATG

You should set this as a value value, like the input value

value=“{{ cart.attributes[“Order Notes”] }}”

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Thanks for your reply, can you please explain in more detail exactly what I need to change and how as I am new to coding.

If possible, I can help you modify it directly. So I need the access to your store.

Is there a solution to this? I have a similar issue with my dropdown

The solution that seemed to work for me was to find the javascript that was throwing the error and tell it that if it’s equal to zero it’s okay,

I found it in the ‘cart.js’ file, search for this (for me it was at line 67 in Dawn):

else if (inputValue % parseInt(event.target.step) !== 0

and change it to this:

else if (inputValue % parseInt(event.target.step) !== 0 && Number.isNaN(parseInt(hello) % parseInt(step)))

Hope that helps someone!

This was so helpful! Thanks!