How to preserve product form values if validation fails when adding to cart?

by Nico   Last Updated August 13, 2019 20:09 PM - source

We have some configurable products in our store with 3 configurable attributes and 3 customizable options. All of these attributes and options are required.

When a customer is on the product page, they make their selections for the attributes and enter values for the options. Then they click "Add to cart".

However, if validation fails on any of these product attributes or options, an error message is displayed and the customer is redirected back to the product page.

The problem is, all the attributes and options that were entered are now reset back to blank values, requiring the customer to re-enter them all again.

Is there any way, when a redirection back to the product page occurs due to a validation error, to preserve the values of the attributes and options that were selected prior to clicking "Add to cart" ? This would be a great time-saver for the customer.

Any assistance is appreciated.



Related Questions





Add multiple items with one click to cart

Updated June 21, 2015 23:04 PM

Get selected Custom Options from configurable product

Updated February 25, 2017 11:09 AM