An Ember Ecosystem
For Spree Commerce

spree-ember-core

Extends DS.ActiveModelAdapter

The Spree Adapter is responsible for communicating with your Spree store. It assumes your server has the spree_ams gem installed.

Methods

Show Private Methods

buildURL

Overrides the default buildURL call to check for the _useCheckoutsEndpoint on the snapshot, (applied to order models in the CanCheckout mixin). If so, the resulting URL will be {hostname}/{namespace}/checkouts/{record_id}. If the flag isn't present, _super is called and the record URL is built normally.

Properties

Show Private Properties

defaultSerializer

String

The container lookup name for the default Spree serializer.


Default: '-spree'

headers

String

A computed property for the adapter headers. We use these headers to authenticate the user against the order we're trying to modify. The spree_ams gem will look for these, and do the work here.


Default: {}

host

String

A computed property for the server host. If it's not set in the Host Application's spree configuration by spree.apiHost, it will default to 'http://localhost:3000' in all environments aside from test, where it will default to null (to satisfy Pretender).


Default: 'http://localhost:3000'

namespace

String

A computed property for the server namespace. If it's not set in the Host Application's spree configuration by spree.apiNamespace, it will default to api/ams, to work out of the box with the spree_ams Gem.


Default: 'api/ams'

spree

Subclass of Ember.Service

A refernce to the Spree Service.