-
Notifications
You must be signed in to change notification settings - Fork 57
Config js
The config.js contains information about the cloud/api architecture as well as business rules for the app.
The advantages of using the RIA approach to developing shopping apps are clearly superior to a traditional e-commerce backend built in php, asp, etc. The RIA framework is designed to NOT be specific to the Zoovy platform, and it could work with any e-commerce system that provides necessary api access for apps. The framework itself was designed with the idea that users could (eventually) have a shopping application built for Zoovy and then use that application to another e-commerce backend (such as Magento, osCommerce, etc.) by simply changing the controller (assuming all API calls were available on both platforms). We encourage other e-commerce systems to develop their own controllers and to extend this framework rather than locking clients into their own proprietary server architecture.
Nothing, the file is generated by the cloud architecture. The config file contains details about the server/cloud platform configuration, not your app. Apps connect to the server/cloud platform api's via the controller.
App's only need to worry about settings that are specific to the problem domain of the extension/application.
That depends on the purpose of the app/extension.
For example if the app/extension has a paypal button it should verify that zGlobals.checkoutSettings.paypalCheckoutApiUser is set, if it is not then the app has two options:
- Display an error 'paypal checkout not available due to missing zGlobals.checkoutSettings.paypalCheckoutApiUser setting, please check account configuration'
- Simply hide the paypal button.
The 'correct' behavior would depend on the app requirements - for example: is paypal the only checkout method supported? if yes - then throwing an error is appropriate, otherwise hiding the paypal button makes more sense.
- The config file should NEVER be copied locally in the project or edited (except to test error handling).
- If there are 'required' settings for your app/extension (ex: a particular checkout setting) that setting should be verified and if the setting in the config file is not compatible then a message stating what functionality will be broken should be displayed to the app user. (Ex: checkout not available due to 'nice' mode, please change to 'passive')
- It is the application(extensions) responsibility to verify that the api backend configuration meets it's needs.
- Again, this will mostly impact the customer, and checkout extensions which are rarely customized.
- NEVER copy the config.js locally, except during development when the server architecture is incompatible or to test error handling when/if the server architecture becomes incompatible.
// config file - this should whitelist this url for future requests.
var zGlobals = {
"cartSettings" : {
"showLowestShipQuoteOnly" : 0,
"canQuoteShippingWithoutZip" : 1,
"getZipForShipQuote" : 1
},
"checkoutSettings" : {
"preference_require_login" : 0,
"customer_management" : "NICE",
"preference_never_create_account" : 0,
"chkout_order_notes" : 1,
"paypalCheckoutApiUser" : "[email protected]",
"preference_request_login" : 1,
"chkout_phone" : "REQUIRED",
"preference_always_create_account" : 0,
"amazonCheckoutMerchantId" : "",
"googleCheckoutMerchantId" : ""
},
"thirdParty" : {
"facebook" : {
"appId" : null
}
},
"globalSettings" : {
"inv_police" : null,
"inv_mode" : null
},
"appSettings" : {
"profile" : "DEFAULT",
"prt" : "0",
"https_app_url" : "https://ssl.zoovy.com/s=downlitebedding.com/",
"https_api_url" : "https://ssl.zoovy.com/s=downlitebedding.com/jquery/",
"http_api_url" : "http://www.downlitebedding.com/jquery/",
"http_app_url" : "http://www.downlitebedding.com/",
"sdomain" : "downlitebedding.com",
"username" : "downlite"
}
}
;
//eof
- 1 = the server recommends that only the lowest priced shipping method be shown to buyers (does not apply to checkout)
- 0 = show all shipping methods returned to the buyer wherever possible.
- 1 = the server can quote shipping using methods that do not require a zip code (ex: flat rate or free shipping)
- 0 = a country and/or zip is recommended prior to quoting shipping costs
- 1 = the server recommends the app obtain a country and/or zip code before requesting a shipping cost estimate.
- 0 = the server does not need a zip code for estimating shipping.
- 1 = customers who have an account will be required to login to the account, app should support/request login to checkout
- 0 = no login is required
-
This enumeration corresponds to the settings 'preference_require_login', 'preference_request_login', 'preference_always_create_account'
-
STANDARD: Require customers to use/create accounts, require existing customers to login.
-
NICE: Prompt customers to use/create accounts, but always let them purchase, even without logging into their account.
-
STRICT: Prompt customers to use/create accounts, and require a customer to login if they have an account.
-
PASSIVE: Never ask customers to create an account, let Zoovy automatically correlate multiple sales by the same customer.
-
DISABLED: Turn off all customer management and tracking.
-
MEMBER: (Members Only) Allow anybody to browse site, but do NOT allow new customers to create an account, or make a purchase (customers must have an account on record to purchase).
-
PRIVATE: REQUIRE customer to login before they can access site, do NOT allow new customers to create an account, or make a purchase.
- 1 = customers(buyers) are not allowed to create account and attempts to create buyer account will fail.
- 0 = buyers can create accounts.
- 1 = merchant configuration will allow order notes (messages from the buyer to the merchant) to be saved to order.
- 0 = merchant cnofiguration does not support order notes, and order notes will be ignored by shipping.
- The email address of the destination paypal account. If set to non-blank value then Paypal express checkout is available.
- 1 = prompt (but do not require) the buyer to login to place an order
- 0 = do not prompt the buyer to login to place an order
- 2 = phone number is REQUIRED to place an order
- 1 = use should be prompted to specify a phone number (optional)
- 0 = phone number is not used and will be ignored/discarded if included in order.
- 1 = a buyer account will automatically be created (if one does not exist), if a buyer account already exists [matched by email address] then the order will be automatically associated.
- 0 = if a buyer does not login the order will not be associated.
- If populated 'Checkout by Amazon' payment method is enabled/accepted.
- If populated Google Checkout payment method is enabled/accepted.
- If populated the ability to login/connect via Facebook (and other facebook api calls) are available.
- 2 = lack of inventory will prevent order from being created.
- 1 = inventory will be verified at checkout prior to order being placed (may take longer, and produce additional errors)
- 0 = no inventory verification will be performed.
- 0 = inventory is disabled/not relevant to this app.
- 2 = inventory is important and status 'in stock' 'out of stock' information should be displayed to the buyer
- 3 = ivnentory is important and specific levels shuold be displayed to the buyer
- Profile is a zoovy specific setting that is useful from a diagnostic setting, it determines which company profile within a single account is selected. It is a string, always uppercase containined 3-8 characters. The profile contains public information such as the company name, logo, etc. Each profile is associated to only one partition. There are some API calls which require this parameter.
- Partition (prt) is a zoovy specific account setting. Multiple business units may operate from within the same account. Each partition has it's own checkout settings, unique navigation, and customer database. Other information such as Products, Inventory, and Suppliers are shared across partitions. Each partition may have one or more profiles linked to it.
- The secure (https) url for the app (where the app itself should be hosted/loaded from).
- The secure (https) url for the api (where the app should communicate for secure checkout).
- The non-secure (http) url for the app (where the app itself should be hosted/loaded from).
- The non-secure (http) url for the api (where the api should communicate for non-secure calls).
- SDomain (Site Domain) is the domain where the business primarily operates from, in most cases this will be the same as the API URL's. It's useful for generating links, etc.
- The zoovy account name associated with this config file, provided for diagnostic purposes.