Skip to content

Commit 004fa5a

Browse files
committed
Debug
1 parent 6f11801 commit 004fa5a

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

components/Cart/AddToCartButton.component.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const AddToCartButton = ({ product }) => {
3434
const { data, refetch } = useQuery(GET_CART, {
3535
notifyOnNetworkStatusChange: true,
3636
onCompleted: () => {
37-
refetch();
37+
//refetch();
3838
// Update cart in the localStorage.
3939
const updatedCart = getFormattedCart(data);
4040

@@ -44,6 +44,8 @@ const AddToCartButton = ({ product }) => {
4444

4545
localStorage.setItem('woocommerce-cart', JSON.stringify(updatedCart));
4646

47+
console.log("Data cart: ", data)
48+
4749
// Update cart data in React Context.
4850
setCart(updatedCart);
4951
},

components/Cart/CartPage/RegularCart.component.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ const RegularCart = ({
2727
</tr>
2828
</thead>
2929
<tbody>
30+
31+
Products: {JSON.stringify(cart)}
32+
33+
3034
{cart.products.length &&
3135
cart.products.map((item) => (
3236
<React.Fragment key={item.cartKey}>

pages/produkt/[slug].js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const Produkt = ({ product }) => {
1616
return (
1717
<>
1818
<Header title={`- ${product.name ? product.name : ''}`} />
19+
20+
Produkt: <pre>{JSON.stringify(product)}</pre>
21+
22+
23+
1924
{product ? (
2025
<SingleProduct product={product} />
2126
) : (

0 commit comments

Comments
 (0)