Closed aldeed closed 6 years ago
@aldeed
Is this new component only supposed to show the price range?
I'm trying to also provide the compareAtPrice
, but it looks like we'll need to refactor how the data is passed if we are going to do that.
compareAtPrice
is never on the product
itself, it's only on variants, so when we convert a Product
schema product to a Catalog
schema product, this data will never be there, as we are trying to get it off the top level product: https://github.com/reactioncommerce/reaction/blob/release-1.14.0/imports/plugins/core/catalog/server/no-meteor/utils/publishProductToCatalog.js#L172
@kieckhafer Hmm, maybe we don't need to do this. I forgot about that, and if grid is only showing a single string generated on the server right now, I guess we don't benefit much from using this component. I guess we should close this?
@aldeed There is a PR ready to go, but it's minimal updates: https://github.com/reactioncommerce/reaction-next-starterkit/pull/156
It just installs the component library and uses the Price
component on one line.
Might be good to leave it as an example of importing the component library, or could also be taken out until the component is more robust. Whatever you think is best.
Work
A new
Price
component was created in the component library forCartItem
. It's the same as the way the price and compareAtPrice is displayed in the product grid, so switch the product grid to use this new component.