feat: adopt product card v2 [MONET-1325] #215
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Shopify App
Switch to new product card to display additional data.
Approach
Use latests build from
@contentful/ecommerce-app-base
and implement a new renderer for additional information.Product - additional data
To display the price for a product, we take into account all prices of its variants, if there vary, we show a price range.
Collection - additional data
To display the number of products within a collection, we query the first 101 product ids (to keep the footprint small) of a collection. If the response has 101 items, we display
> 100
for the products count. This stunt is unfortunately necessary, as there is no count pro provided by the Shopify API (if you know a better way, please change it).Testing steps
I assume this has to be tested manually
Dependencies and/or References
This is based on contentful/apps#4534
Screenshots
Collection
Product
Variant
ToDo:
Once the foundational work is released, the
@contentful/ecommerce-app-base
dependency has to be updated, and therelativeDependencies
removed.