-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes ability to add configurable items to cart until options are c…
…hosen (#1097) * Disables Add to Cart button until configurable products have all options chosen * Updates logic to determine if a product is configurable. - Is now based on the product __typename - No longer checks if configurable_items is an array * Updates configurable item fixture to fix broken tests
- Loading branch information
1 parent
9afa103
commit ddcd58a
Showing
9 changed files
with
70 additions
and
27 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...es/pwa-buildpack/src/WebpackTools/__tests__/__fixtures__/queries/getProductDetail.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/venia-concept/src/queries/getProductDetailByName.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
packages/venia-concept/src/util/__tests__/isProductConfigurable.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import isProductConfigurable from '../isProductConfigurable'; | ||
|
||
test('returns true for a configurable product', () => { | ||
const product = { | ||
__typename: 'ConfigurableProduct' | ||
}; | ||
|
||
const result = isProductConfigurable(product); | ||
|
||
expect(result).toBe(true); | ||
}); | ||
|
||
test('returns false for a non-configurable product', () => { | ||
const product = { | ||
__typename: 'SimpleProduct' | ||
}; | ||
|
||
const result = isProductConfigurable(product); | ||
|
||
expect(result).toBe(false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const isProductConfigurable = product => | ||
product.__typename === 'ConfigurableProduct'; | ||
|
||
export default isProductConfigurable; |
ddcd58a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully aliased the URL https://magento-venia-ocifdlagdp.now.sh to the following aliases.