The lineItemQuantityErrorText configuration parameter sets the error message text that appears in data-ajax-cart-messages containers with the line_item.key value when a user tries to set a cart item’s quantity higher than the available quantity of the product.

By default the text is “You can’t add more of this item to your cart”.

You can change the message if your store language is not English or the phrase doesn’t fit to your store:

{% comment %} Somewhere in layout/theme.liquid {% endcomment %}

<script type="application/json" data-ajax-cart-configuration >
    "lineItemQuantityErrorText": "{{ 'sections.cart.cart_quantity_error' | t }}"

You can also use the configureCart function:

<script type="module">
  import { configureCart } from '{{ "liquid-ajax-cart-v1.10.3.js" | asset_url }}';

  configureCart('lineItemQuantityErrorText': 'My quantity error text');