Search code examples
magentomagento2magento-2.3magento2.2magento2.1

auto fill sign up data in custom form Magento 2 frontend


Someone please suggest the solution?

I want prefilled data in my custom form that user already entered in the signup form.

Thanks, Rashi


Solution

  • You could use the customer's local storage. Long story, thus you can check this blog for more information.

    When we've got the customerData from the Magento_Customer/js/customer-data.js source, you can fill the form with it. $('#custom-form-username').val(customerData.get('name')); . I hope this will give you some directions.