Magento 2.4 Custom form validation mage error duplication

Mage error component is duplicating error warnings on form inputs. Steps to reproduce-Submit blank login form;-Fill the input and submit again;-Remove the input field and submit blank form again.-Click one more time on submit button. Solution:- When we write a js for the submission of the please confirm that the form is valid or not.… Continue reading Magento 2.4 Custom form validation mage error duplication

How to configure qty to use decimal quantities in magento 2

In some Cases we may need to use qty to use decimal in our store so inorder to enable this we have two provisions to select that to each product based or we can totally declare to allow decimal for qty values. Display settings for each individual productGo to the following link : Admin panel… Continue reading How to configure qty to use decimal quantities in magento 2

Adding Remember Me To Magento Sign In and Sign Up Pages

Magento has default feature to keep the user logged in to a particular browser and for custom design it may not be visible . Add the following to custom module layout to Magento Customer>layout>customer_account_login.xml and customer_account_create.xml Turn on the persistence option in back end.

Method to add custom JS validation rule in Magento 2

Add requirejs-config.js file to the following location: app/code/[Vendor]/[Module]/view/frontend/requirejs-config.js Copy file vendor/magento/module-ui/view/base/web/js/lib/validation/rules.js to app/code/[Vendor]/[Module]/view/frontend/web/js/lib/validation/rules.js Where you can add the custom validation code as following: That’s it. Overriding the inbuilt JS also done in the same,if you are using a custom , create a folder with the same naming pattern in the vendor folder structure and paste… Continue reading Method to add custom JS validation rule in Magento 2

Magneto Event before customer login to clear carts for logged out customers

Here the art will be updated with custom pricing for the customer when the customer logged in. With the help of a observer it can be done:- The event used to trigger the Observer will be :- controller_action_predispatch_customer_account_loginPost Observer will contain the repository of Quote,Customer section and cart.