Simulate click and set guest in checkout/onepage/ (skipping first step)
-
16-10-2019 - |
Question
I was wondering, can we (and how) emulate a click and set guest in checkout/onepage/ (skipping first step)
Ofcourse there is a plugin, but we have had some bad experiences with this (Crius skipstep) working on and off (and related to responsive theme)
Ideally: could we keep first step, but directly onload emulate a SET TO GUEST and CLICK NEXT
Thx!
Solution
I needed to simulate click events a few times and the best solution for Magento (since it is based on Prototype) was event.simulate.js - https://github.com/kangax/protolicious/blob/5b56fdafcd7d7662c9d648534225039b2e78e371/event.simulate.js
You only need to include the javascript and then you can simulate clicks like:
$('foo').simulate('click');
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange