I can’t translate the top checkout error message "The requested qty exceeds the maximum qty allowed in shopping cart", the item error message translates ok. Where is the location of this piece of code?:
<div class="message message-error error"><div data-ui-id="checkout-cart-validationmessages-message-error">The requested qty exceeds the maximum qty allowed in shopping cart</div></div>
3
Answers
This message is located in the file:
vendor/magento/module-checkout/view/frontend/web/template/messages.html
You can modify this file to change the message.
To find where the message file is located, you can enable the Magento 2 debug template functionality to highlight the template file:
To enable template hints:
Click Stores > Settings > Configuration > ADVANCED > Developer
In the Scope: dropdown in the upper-left corner, select the view for which you want the template hints.
In the Debug tab, set Template Path Hints for the storefront to Yes.
To enable path hints for Admin, set Template Path Hints for Admin to Yes.
To save the changes, click Save Config in the upper-right corner.
Use the bin/magento dev:template-hints:enable command to enable template hints and the bin/magento dev:template-hints:disable command to disable them.
Other Way
Once you find the file path, although, in Magento 2, the messages are in CSV format for every module, i.e., in vendor/magento/module-catalog-inventory/i18n/en_US.csv. You can change and customize your messages in this file for the module.
That’s it
This text is available in following path
vendor/magento/module-inventory-sales/Model/IsProductSalableForRequestedQtyCondition/IsCorrectQtyCondition.php#112
You can change here But it would be more correct to change from translation file