Skip to content
This repository has been archived by the owner on Aug 12, 2018. It is now read-only.
/ react-shopify-theme Public archive

Higher order components for creating Shopify themes

Notifications You must be signed in to change notification settings

sdn90/react-shopify-theme

Repository files navigation

Build Status

React Shopify Theme

React components for Shopify themes.

API

OptionSelectionEnhancer

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:

variants: object[]

The array of variants

options: string[]

The array of options


The new component will receive the following props:

addDisabled: boolean

If the current selected variant is not able to be added to the cart.

changeHandler: function(optionName:string, optionValue:string) : void

The function to change the current selected variant.

hasVariants: boolean

Whether or not there are multiple variants. Use this to determine whether or not to show input options.

selectedVariant: object

The selected variant

uniqueOptions: object[]

The unique options and values

[
  {
    name: 'Color',
    values: ['Blue', 'Green', 'Red']
  },
  {
    name: 'Size,
    values: ['Small', 'Medium', 'Large']
  }
]

Examples

Codepen Demo

About

Higher order components for creating Shopify themes

Resources

Stars

Watchers

Forks

Packages

No packages published