React components for Shopify themes.
OptionSelectionEnhancer is a customizable alternative to Shopify's option_selection.js.
OptionSelectionEnhancer is a higher order component.
The enhanced component will require the following props:
The array of variants
The array of options
The new component will receive the following props:
If the current selected variant is not able to be added to the cart.
The function to change the current selected variant.
Whether or not there are multiple variants. Use this to determine whether or not to show input options.
The selected variant
The unique options and values
[
{
name: 'Color',
values: ['Blue', 'Green', 'Red']
},
{
name: 'Size,
values: ['Small', 'Medium', 'Large']
}
]