Fix numeric attributes not returned. Issue #74 #98
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.
Numeric attributes are not stored in the Item Attribute Value table so they are never returned by get_attributes_and_values(). For reference, they are stored in Item Attribute table.
However, they are included in item_variants_data which is then loaded into valid_options. If they are not found in ordered_attribute_value_map sort and add them to it.
This does not include the entire range if there is no product associated with specific number. Only possible selectable values are returned so that the user doesn't waste time selecting a number that is not available.
For example, if the range is incremented by 1 for 1 to 100 but there are only variants for 1,20, and 37, the selectable options returned will be [1,20,37] instead of [1,2,3,...,99, 100] and making the user guess which item is available.