Our payment service provider only allow certain input lengths for some fields.
In this case I want to show a inputfield error in the checkout, when the input of the street name is longer than 35 characters for example.
How can I achieve this?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityOur payment service provider only allow certain input lengths for some fields.
In this case I want to show a inputfield error in the checkout, when the input of the street name is longer than 35 characters for example.
How can I achieve this?
You can add the class validate-length maximum-length-35
in every template where there is an input for the street.
For example, in app/design/frontend/<your-package>/<your-theme>/template/checkout/onepage/billing.phtml
, replace :
class="input-text <?php echo $_streetValidationClass ?>"
by
class="input-text validate-length maximum-length-35 <?php echo $_streetValidationClass ?>"
csv
file ;). By the way, it's weird that it's not translated with your change...(did you flush the cache, etc) To translate Text length does not satisfy specified text range.
, I would use a translate.csv
file in app/design/frontend/<your-theme>/default/locale/<your-locale>/translate.csv
.
– Julien Loizelet
Mar 7 '18 at 11:35