I've got a custom datepicker on my site that allows customers to put orders on hold. On my product page (pre-FoxyCart), the customer can pick a date before they add their order to the cart. When they pick a data, this gets executed:
That way, the date is set in FC.json.custom_fields.DeliveryDate when they get to the cart (right?), and it populates the date picker on my checkout page so customers can change it there if they want.
Here's the thing, though. Customers are having problems with dates being set when they didn't mean to or the incorrect date is being set. I stepped through the code as the cart loads and noticed that a function named storeDataInJSON() runs. This function winds up setting FC.json.DeliveryDate. I think this is the root of the problem I'm having. I've been using and manipulating FC.json.custom_fields.DeliveryDate, but FC.json.DeliveryDate is also set. So, questions:
- My call from the product page IS setting FC.json.custom_fields.DeliveryDate, right? It's not setting FC.json.DeliveryDate too, is it?
- Assuming the previous point is correct, what is the storeDataInJSON function doing? How do I keep DeliveryDate from being set there?
- SHOULD I be preventing DeliveryDate from being set in FC.json.DeliveryDate, or should I clear FC.json.custom_fields.DeliveryDate on load and use FC.json.DeliveryDate instead?