How to enable autocomplete for the checkout form? Currently my browser (chrome) does not store any input values...
-
Which fields are you talking about? Which browser? There is a CSS or form field attribute (don't remember properly) which you can use to influence autocomplete.– AlexJun 5, 2013 at 13:17
-
But this is more or less a browser-question. Maybe magento's field names are to strange for some browsers (because of the PHP arrays ... i.e. billing[firstname])– AlexJun 5, 2013 at 13:19
-
& did you try if it works on other shops? Your address etc. might just not be cached in your developer's machine?– AlexJun 5, 2013 at 13:20
-
Happends with chrome on demo.magentocommerce.com It can't be CSS and I don't see any autocomplete attribute, could be caused by JavaScript.– PiTheNumberJun 5, 2013 at 13:22
-
Confirmed. I had chrome://settings/autofill empty first, but after fixing this it still does not work. On other shops it does work.– AlexJun 5, 2013 at 13:27
3 Answers
We did the following on Magento 1.8.1
changed as described by Inchoo in billing.phtml. Don;t forget to change both in template/checkout/ and template/persistent
form id="co-billing-form" method="post" autocomplete="on" action=""
Updated opcheckout.js
elements[i].setAttribute('autocomplete','on');
This works fine now.
One thing we do see however. If you have some nice CSS set-up that add the checkmarks or other to validated fields is that the autocomplete overwrites this with the infamous yellow background
Our friends over at Inchoo have a nice article on this along with a fix. Basically, you just need to add a method to the form, either post or get.
In template/persistent/checkout/onepage/billing.phtml
add method="post"
in line 28:
<form id="co-billing-form" method="post" action="">
<fieldset>
<ul class="form-list">
Magento disables the automatic filling of some forms.
This is done by calls like elements[i].setAttribute('autocomplete','off');
in opcheckout.js
.
But even uncommenting this call did not make it work.
If you search the code for a RegEx autocomplete.*off
there are many places where autocomplete is disabled.
There are browser plugins to override this - but I guess you want to make the shopping experience better for all customers, without the need to install a plugin ;-)
So there would be some debugging needed - please share your results!