Shop/Methods

Shop/Methods

Methods

(static) shop/createShop(shopAdminUserId, partialShopData) → {String}

Source:
Parameters:
Name Type Description
shopAdminUserId String

optionally create shop for provided userId

partialShopData Object

optionally provide a subset of shop data which will be merged with properties from the primary shop in order to create a document which meets the Shops schema requirements.

Returns:

return shopId

Type
String

(static) shop/createTag(tagName, isTopLevel) → {String}

creates new tag

Source:
Since:
  • 0.14.0
Parameters:
Name Type Description
tagName String

new tag name

isTopLevel Boolean

if true -- new tag will be created on top of tags tree

Returns:

with created tag _id

Type
String

(static) shop/locateAddress(latitude, longitude) → {Object}

determine user's full location for autopopulating addresses

Source:
Parameters:
Name Type Description
latitude Number

latitude

longitude Number

longitude

Returns:

returns address

Type
Object

(static) shop/togglePackage(packageId, enabled) → {Number}

enable/disable Reaction package

Source:
Parameters:
Name Type Description
packageId String

package _id

enabled Boolean

current package enabled state

Returns:

mongo update result

Type
Number

(static) shop/updateBrandAssets(asset) → {Int}

Source:
Parameters:
Name Type Description
asset Object

brand asset {mediaId: "", type, ""}

Returns:

returns update result

Type
Int

(static) shop/updateCurrencyConfiguration(currency, enabled) → {Number}

enable / disable a currency

Source:
Parameters:
Name Type Description
currency String

currency name | "all" to bulk enable / disable

enabled Boolean

true / false

Returns:

returns mongo update result

Type
Number

(static) shop/updateHeaderTags(tagName, tagId, currentTagId) → {Boolean}

method to insert or update tag with hierarchy

Source:
Parameters:
Name Type Description
tagName String

will insert, tagName + tagId will update existing

tagId String

tagId to update

currentTagId String

currentTagId will update related/hierarchy

Returns:

return true/false after insert

Type
Boolean

(static) shop/updateLanguageConfiguration(language, enabled) → {Array}

enable / disable a language

Source:
Parameters:
Name Type Description
language String

language name | "all" to bulk enable / disable

enabled Boolean

true / false

Returns:

returns workflow array

Type
Array

(static) shop/updateShopExternalServices(details) → {undefined}

we need to rerun fetch exchange rates job on every form submit, that's why we update autoform type to "method-update"

Source:
To Do:
  • This method fires Packages collection, so maybe someday it could be moved to another file

On submit OpenExchangeRatesForm handler

Parameters:
Name Type Description
details Object

An object with _id and modifier props

Fires:
  • Collections.Packages#event:update
Returns:
Type
undefined