solidus

https://github.com/solidusio/solidus

Ruby

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.

Spree::Api::ProductsController#create

Takes besides the products attributes either an array of variants or
an array of option types.

By submitting an array of variants the option types will be created
using the *name* key in options hash. e.g

  product: {
    ...
    variants: {
      price: 19.99,
      sku: "hey_you",
      options: [
        { name: "size", value: "small" },
        { name: "color", value: "black" }
      ]
    }
  }

Or just pass in the option types hash:

  product: {
    ...
    option_types: ['size', 'color']
  }

By passing the shipping category name you can fetch or create that
shipping category on the fly. e.g.

  product: {
    ...
    shipping_category: "Free Shipping Items"
  }

Source | Google | Stack overflow

Edit

git clone [email protected]:solidusio/solidus.git

cd solidus

open api/app/controllers/spree/api/products_controller.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--Api--ProductsController-create-for-pr


# Commit to git

git add api/app/controllers/spree/api/products_controller.rbgit commit -m "better docs for Spree::Api::ProductsController#create"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--Api--ProductsController-create-for-pr

hub pull-request


# Celebrate!