I have created close to thirty custom checkout fields on the checkout screen (Commerce setup --> Checkout). One problem that I have is that I need the data stored in the fields to persist in these two cases:
1. If during the form validation of the Bill to or Payment data on the Checkout page, it finds an error, instead of clearing my custom checkout fields I need it to persist the data on the checkout page.
2. If the Checkout page validates and the user is taken to the Confirmation page, they review the order and need to Make Changes, i.e. They click on the Make Changes button, the custom checkout fields are cleared and the user must reenter all of the data.
What I need is a way to use non-persistent cookies or session variables. I don't want the data persisting beyond the scope of a users session. If anyone has a way to solve the problem I'm open to any suggestions.
I'm assuming the only way to do this is in the Checkout page and to add JavaScript to the built in Check-it function.
It seems like I need to call a function from the onLoad() function based upon all the example JavaScript code I am finding. Not sure if there is a location within ShopSite to add code during the onLoad event?
Has anyone ran into this problem or know of a solution that they could share with me? I'd appreciate some details on how to do this and hopefully some sample code.
Thank you