Connected and enabled co-maket

This commit is contained in:
Nedim Uka
2018-08-08 14:40:00 +02:00
parent 5d84f53ea7
commit 0b899c09af
7 changed files with 202 additions and 126 deletions

View File

@@ -56,6 +56,7 @@ export const receiveCustomerDetails = (json) => ({
export const fetchCartCount = () => {
return dispatch => {
<<<<<<< HEAD
dispatch(requestShopCartCount());
//TODO : fetch cart count from woocommerce (requires plugin)
dispatch(receiveShopCartCount(0));
@@ -68,6 +69,17 @@ export const fetchCartCount = () => {
client.onError(error, dispatch);
});
*/
=======
// TODO Fetch correct cart count after adding support to cart on API
// dispatch(requestShopCartCount());
// return client.fetch({url: `${API_SERVER}/cart/api/getCartCount`}).then(response => {
// if (typeof response.data !== 'undefined' && 'cartItemsCount' in response.data) {
dispatch(receiveShopCartCount(0));
// }
// }).catch(error => {
// client.onError(error, dispatch);
// });
>>>>>>> 6e0c26d... Connected and enabled co-maket
}
}