Created
March 8, 2012 15:39
-
-
Save rsanchez/2001555 to your computer and use it in GitHub Desktop.
CartThrob forms JSON response
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//successful form submission | |
{ | |
"success": 1, | |
"errors": {}, | |
"return": "http://yoursite.com/path/to", | |
"XID": "0394wjg0w9rj0e65gmaode509gj095e", //only if secure forms is turned on | |
"cart_total": 100, | |
"cart_subtotal": 80, | |
"cart_discount": 0, | |
"cart_tax": 10, | |
"cart_shipping": 10 | |
} | |
//failed form submission | |
{ | |
"success": 0, | |
"errors": { | |
0: "This item is out of stock", | |
"title": "You must submit a title" | |
}, | |
"return": "http://yoursite.com/path/to", | |
"XID": "0394wjg0w9rj0e65gmaode509gj095e" //only if secure forms is turned on | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Returning total_items_count would be really useful here