megamiska Merchant Lähettäjä Slovenia Jäsen alkaen lokak. 2023 megamiska 20 maalisk. 2025 10:32 Hi, some customers tell me that checkout is little bit confusing when there is error in customer_details it don't show where is error until you go down. Is possible to make field with error red border when customer click "save changes" and write bellow field what is wrong /missing like "you must enter valid email"? Here is sample:
jackmaessen LiteCart Fan Lähettäjä Netherlands Jäsen alkaen jouluk. 2022 jackmaessen 20 maalisk. 2025 22:04 not a very beautiful method, but you can do something like below: https://github.com/litecart/litecart/blob/2.6.2/public_html/includes/entities/ent_order.inc.php#L570 // Validate customer details try { if (empty($this->data['customer']['firstname'])) { $inputName = 'firstname'; throw new Exception(language::translate('error_missing_firstname', 'You must enter a first name.')); } if (empty($this->data['customer']['lastname'])) { $inputName = 'lastname'; throw new Exception(language::translate('error_missing_lastname', 'You must enter a last name.')); } if (empty($this->data['customer']['address1'])) { $inputName = 'address1'; throw new Exception(language::translate('error_missing_address1', 'You must enter an address.')); } //....and so on And some later in the catch: https://github.com/litecart/litecart/blob/2.6.2/public_html/includes/entities/ent_order.inc.php#L615 } catch (Exception $e) { ?> <!-- add div in DOM after each input with the error message --> <script> $('input[name="<?php echo $inputName; ?>"]').after('<div class="input-error"><?php echo $e->getMessage(); ?></div>');</script> <?php return language::translate('title_customer_details', 'Customer Details') .': '. $e->getMessage(); } And for your styling .input-error { background-color: red; color: #fff; padding: 5px; border-radius: 8px; }
megamiska Merchant Lähettäjä Slovenia Jäsen alkaen lokak. 2023 megamiska 21 maalisk. 2025 07:54 Thanks! Will try!
tim Founder Lähettäjä Sweden Jäsen alkaen toukok. 2013 tim 24 maalisk. 2025 18:43 For client side validations see this event method: https://www.w3schools.com/tags/ev_oninvalid.asp