Skip to content

Commit

Permalink
Refetch cart
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Oct 2, 2022
1 parent 53975eb commit 3a39781
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/Cart/CartPage/CartItemsContainer.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ const CartItemsContainer = () => {
const { data, refetch } = useQuery(GET_CART, {
notifyOnNetworkStatusChange: true,
onCompleted: () => {
refetch();

// Update cart in the localStorage.
const updatedCart = getFormattedCart(data);
localStorage.setItem('woocommerce-cart', JSON.stringify(updatedCart));
Expand Down

0 comments on commit 3a39781

Please sign in to comment.