/** * Checkout sub-component * Handles the Continue Shopping and Checkout elements * * @type {*|Function} * * @author Rai Icasiano */ window.Checkout = React.createClass({ checkout: function () { this.props.setLoading(true); let quantity = document.getElementsByClassName('productQuantityList'); let ISBN = document.getElementsByClassName('productISBNList'); let products = []; for (let i = 0; i < quantity.length; ++i) { products.push({ "quantity": quantity[i].value, "isbn": ISBN[i].value }); } let successCallback = function () { window.location = '/education/africa_order_request_form'; }; let failCallback = function(componentReference) { componentReference.props.setAPIError(true); componentReference.props.setLoading(false); }; postCart(this, successCallback, failCallback, products, '/education/africa_order_request_form'); }, render: function () { return (
Continue shopping Proceed to Checkout
); } });