I have limited the number of items allowed in shopping cart to 4. That I've done successfully. however I didn't like the displayed message:
The most you may purchase is 4
I want to change it, where/how can I do this?
localisationmagento-2.1magento2messages
I have limited the number of items allowed in shopping cart to 4. That I've done successfully. however I didn't like the displayed message:
The most you may purchase is 4
I want to change it, where/how can I do this?
The message that you have noted in your question is dealt with on the customer_address_save_after
event. Once the function as been called the message is simply added to the customer session as either a success or an error message.
if (!$validationMessage->getIsError()) {
Mage::getSingleton('customer/session')->addSuccess($validationMessage->getMessage());
} else {
Mage::getSingleton('customer/session')->addError($validationMessage->getMessage());
}
Now these customer session messages can appear on pages that has one of the following blocks on it.
<block type="core/messages" name="global_messages" as="global_messages"/>
<block type="core/messages" name="messages" as="messages"/>
So if the user saves an address in the checkout the message is not guaranteed to display on the checkout page, as the complete page is not reloaded only the next section of the one page checkout. So the next page a user sees that could contain these messages could be the homepage.
Best Answer
you need to override
app/code/Magento/CatalogInventory/Model/StockStateProvider.php
change the below line
To
for alternate solution you can create own module that contains a translation file i18n/en_US.csv. here you can translate your phrase
The most you may purchase is to whatever message you need