Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
DARK: fix the id field is required (#423)
Browse files Browse the repository at this point in the history
## QA Steps
[Thread
link](https://youcan-shop.slack.com/archives/C04BDG9HEB1/p1704305203081529)

- [ ] go to the product page and try to buy or add a product to the
cart.
-  [ ] verifie that the product will be added to the cart

## Note

Fix the issue on product page when u try to buy a product
  • Loading branch information
adildev101 authored Jan 4, 2024
1 parent 86af5f4 commit a087b7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sections/product.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@
* Well technically, if the seller didn't choos a default variant, we shouldn't select one.
* The customer should be prompted to select one, if not, they get a warning message.
*/
const defaultVariant = variants.find(variant => variant.is_default);
const defaultVariant = variants.find(variant => variant.is_default) || variants[0];
const globalProductStr = `{{ selected_product | json }}`;
const globalProduct = JSON.parse(globalProductStr.slice(1, -1));

Expand Down

0 comments on commit a087b7b

Please sign in to comment.