/** * Clear Cart sub-component * * @type {*|Function} * * @author Rai Icasiano */ window.ClearCart = React.createClass({ clearCart: function() { this.props.setLoading(true); let successCallback = function () { window.location = '/education'; }; let failCallback = function (componentReference) { componentReference.props.setAPIError(true); }; //API Call deleteCart(this, successCallback, failCallback); }, displayModal: function () { this.props.setConfirmModal(true); this.props.setConfirmModalAction(this.clearCart); this.props.setConfirmModalErrorMessage('Clearing your cart will also return you to the homepage. Are you sure you want to do this?'); }, render: function () { return (
Clear Cart
); } });