In my application I need to talk to the PHP backend after a product has been added to the cart. Maybe the product will be added to a backup-database-cart as well, or in any case generate a correct response message for the customer that perhaps includes some special offer values depending on the product.
I'm using JSONP to send an add to cart
request to FoxyCart using a HMAC form. As far as I can tell there is no response that specifically tells me what product I just added, correct? I have the form data (I sent to FC server), so should I trust that it is the same? How do I know that the add to cart
was successful .. should I check the JSON response messages.errors
for specific things before "assuming" that everything was OK?
I mean, I don't want to give incorrect feedback to the customer telling them that it all went OK etc. when it actually went wrong, or when the product added to the cart in the end isn't 100% the stuff that was sent in the first place (for whatever reason).
Or maybe this is some stuff that is never going to happen anyway?
PS > I will also use the postprocess event to do stuff with the entire cart (like update a mini cart or store it in the db as backup), but then I use the current (local) FC.json object fetched after cart_update. But that is after the fact..