These are chat archives for reactioncommerce/reaction

18th
Dec 2016
Michael Duane Mooring
@mikeumus
Dec 18 2016 19:33 UTC
I found you can get the child variants of a topVariant by passing the topVariant"s Id to getTopVariants() :)
Don't know if making an alias method for that is worth it to save people some time realizing that getTopVariants() will work for this as well if they're just exploring the methods available in ReactionProducts.
Michael Duane Mooring
@mikeumus
Dec 18 2016 19:42 UTC

So I'm looking at the schema for productvariantand see that price is optional, but then why when I'm trying to publish this product it's saying it requires a price for a number of variants?
In the meteor run terminal it's outputted:

'products/deleteVariant' Error: Min must be a number

and

Sanitized and reported to the client as: Min must be a number [400]

Brent Hoover
@zenweasel
Dec 18 2016 22:11 UTC
@andela-akolawole You can look at the existing tests. There should be some examples there. For example product-publications-app-test.js
@mikeumus That’s because top-level products don’t need to have a price since their price can be derived from their children, but variants must have a price
Michael Duane Mooring
@mikeumus
Dec 18 2016 23:50 UTC
Thanks @zenweasel 🙇, variants as in product options / child variants you're referring to?
Brent Hoover
@zenweasel
Dec 18 2016 23:51 UTC
it’s true of both variants and options afaik
Michael Duane Mooring
@mikeumus
Dec 18 2016 23:51 UTC
k
Brent Hoover
@zenweasel
Dec 18 2016 23:52 UTC
the schema has only the two types, simple and variant. Technically I guess we could have a third type called option but it seems like that would add unecessary complexity