-
Notifications
You must be signed in to change notification settings - Fork 887
Configuration
All settings can be made in the config file and some settings can also be managed from the admin panel (http://127.0.0.1:1111/admin).
Settings are stored in JSON files in the /config directory. The main application-level settings are stored in /config/settings.json while payment gateway settings are stored in files in the /config directory named after the payment gateway. For example, configuration for the Stripe payment gateway is stored in /config/payment/config/stripe.json.
Configs are validated against the schema files. For the settings.json this will be validated against the settingsSchema.json file. The Payment gateway config is validated against the /config/payment/schema/<gateway>.json file.
Environment configuration can be achieved using an env.yaml file (in the root of the app) to override any settings. You may want to do something like:
development:
port: 1111
databaseConnectionString: mongodb://127.0.0.1:27017/expresscart
production:
port: 2222
databaseConnectionString: mongodb://prod_db_url:27017/expresscartThe app will read in the NODE_ENV and switch and override any valid settings. Eg: databaseConnectionString set in the env.yaml file will override anything in settings.json file.
This can also be used for payment modules too. Any settings in the env.yaml file will override the /config/payment/config/<gateway>.json file.
| Property | Description |
|---|---|
| cartTitle | This element is critical for search engine optimisation. Cart title is also displayed if your logo is hidden. |
| cartDescription | This description shows when your website is listed in search engine results. |
| cartLogo | URL to the logo for your cart |
| baseUrl | This URL is used in sitemaps and when your customer returns from completing their payment etc. |
| emailHost | The host address of your email provider |
| emailPort | The post of your email provider |
| emailSecure | The secure true/false indicator |
| emailUser | The email user. Normally the email address. |
| emailPassword | The password of your email provider |
| emailAddress | This is used as the from email when sending receipts to your customers. |
| productsPerRow | The number of products to be displayed across the page. |
| productsPerPage | The number of products to be displayed on each page. |
| footerHtml | Any HTML you want to be displayed in the footer of each page |
| googleAnalytics | Your Google Analytics code. Also include the <script> tags - More info
|
| injectJs | Javascript code you want to inject onto pages. You may use this for Chatbots etc. |
| customCss | Custom CSS which will override the base CSS |
| currencySymbol | Set this to your currency symbol. Eg: $, £, € |
| currencyISO | Set this to your currency ISO code. Eg: USD, AUD, EUR, GBP etc |
| paymentGateway | An array of Payment Gateways or providers to be used. |
| databaseConnectionString | The MongoDB database connection string |
| theme | The name of the Theme to be used |
| trackStock | Whether your cart will track stock levels |
| orderHook | On the completion of a order, expressCart will POST the data to the configured URL |
| availableLanguages | Language to use. Eg: en or it
|
| defaultLocale | The default language/locale to fall back to for translations |
| maxQuantity | The maximum quantity of any product which can be added to the cart. |
| twitterHandle | The Twitter @ handle used in SEO |
| facebookAppId | The Facebook App ID used in SEO |
| productOrderBy | The field in which the products are ordered by. Eg: Product title etc |
| productOrder | The sort order of products. Eg: ascending or descending
|
| modules | The modules configured and enabled. Check settings.json for example. |
| showRelatedProducts | Shows related products when viewing a product for cross selling |
| showHomepageVariants | Whether to show the product variants (eg: size etc) in a dropdown on the homepage when displaying products. |