Skip to content

Commit

Permalink
Merge pull request #196 from w3bdesign/development
Browse files Browse the repository at this point in the history
Some debugging
  • Loading branch information
w3bdesign authored Jul 6, 2020
2 parents 62875c6 + 25abbaa commit d707d12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

## TODO

- Display product variation in cart / checkout
- Display product variation name in cart / checkout
- Implement React-hook-form for validation
- Hide products not in stock
- Add better SEO
- Add a better README.md
Expand Down
6 changes: 5 additions & 1 deletion components/Cart/AddToCartButton.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ const AddToCartButton = (props) => {

const product = props.product;

const productId = product.productId ? product.productId : product;

console.log("Props from Addtocart");
console.log(props);

const productQueryInput = {
clientMutationId: uuidv4(), // Generate a unique id.
//productId: product.productId,
productId: product
//productId: product
productId: productId
};

// Get Cart Data.
Expand Down
6 changes: 6 additions & 0 deletions components/Cart/CartPage/CartItem.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { getUpdatedItems } from 'utils/functions/functions';
const CartItem = ({ item, products, handleRemoveProductClick, updateCart }) => {
const [productCount, setProductCount] = useState(item.qty);

console.log("Cart item: ");
console.log(item);
console.log("Cart products: ");
console.log(products);


/*
* When user changes the quantity, update the cart in localStorage
* Also update the cart in the global Context
Expand Down
5 changes: 1 addition & 4 deletions components/Product/SingleProduct.component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import LoadingSpinner from 'components/LoadingSpinner/LoadingSpinner.component';
*/
const SingleProduct = ({ product }) => {
const [isLoading, setIsLoading] = useState(true);
// Set first variation as default selected variant
const [selectedVariation, setselectedVariation] = useState(
product.variations.nodes[0].variationId
);
const [selectedVariation, setselectedVariation] = useState(64);

useEffect(() => {
setIsLoading(false);
Expand Down

1 comment on commit d707d12

@vercel
Copy link

@vercel vercel bot commented on d707d12 Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.