Skip to main content

Configuration for your launchpad

In short; everything is set up for you. You can start building your store right away. This launchpad also comes with a test drive payment gateway and a freight checkout. This means that you can test your store right out-the-box without having to set up a payment gateway or freight provider.

General setup

Environment variables

In the root of the project, you will find an .env.example file. This file contains all the environment variables that are needed for the project to run.

Tip

If you want to run your store with a multi market setup (with /market/language in the url), then just remove the DOMAINS variable and your site will default to multi market.

VariableDescriptionRequiredExample value
API_ENDPOINTThe API endpoint for your Geins Merchant APIYeshttps://url.com
API_KEYYour Geins Merchant API keyYes00000000-0000-0000-0000-000000000000
AUTH_ENDPOINTThe auth endpoint for your Geins Merchant APIYeshttps://url.com
SIGN_ENDPOINTThe sign endpoint for your Geins Merchant APIYeshttps://url.com
BASE_URLThe base URL for your store including http/https without ending slashYeshttps://url.com
FALLBACK_CHANNEL_IDThe fallback channel ID for your storeYes1ǀse
FALLBACK_MARKET_ALIASThe fallback market alias for your storeYesse
DEFAULT_LOCALEThe default locale for your storeYessv
RALPH_ENVThe environment for your store (dev, qa or prod)Nodev
DOMAINSThe domains for your store (if you want to use different domains for different languages/markets)Nosvǀwww.site.se,fiǀwww.site.fi

If you only have one market, your DOMAINS variable should look like this: DOMAINS=sv|www.site.se. For your local dev environment the equivalent would be DOMAINS=sv|localhost:3000.

Nuxt config

In the Nuxt config file nuxt.config.js you can set up most things, for example routes configuration and your runtime config (global variables that are accessed through the $config object). Please refer to the Nuxt Configuration Glossary for more information. We will dive deeper into our Nuxt config setup further down this page.

Channel settings

You will find some channel settings in config/channel-settings.js. This is a good place to set up and add variables that differs between channels. All variables added to the theme property will get converted into global CSS variables and can be used throughout the application. The channel settings are imported into the Nuxt config file as currentChannelSettings and can be used for setup there. This below is the default setup for the channel settings.

config/channel-settings.js
export const channelSettings = [
{
channelId: '1|se',
siteName: 'Ralph Storefront', // Change this to the name of your store
theme: {
'accent-color': '#131313', // Change this to yours
// Add more theme variables here if you like
},
},
];

Design setup

Assets

Add your desired logos and fonts etc to the assets folder. In the static folder, you should replace the favicon.ico, icon.png and the meta-image-fallback.jpg with your own. Here is also where you can add assets for your Geins generated emails, in the static/mail folder.

Icons

By default, the project comes with a set of icons from Feather Icons in the assets/icons folder. You can use these icons throughout the application, for example by using the CaIcon component. You can also add your own icons to this folder. To decrease the size of the site bundle, only the icons that are actively used in the project are included in the assets/icons folder. The rest of the icons you can find in the assets library folder in the root of the project.

Styles

In the styles folder, you'll find all the styles for the application. For the general setup, it is suggested to look through and adjust the files in the styles/variables folder, and also the styles/global and the styles/helpers folders.

All styles are written in SASS, and the styles are structured according to the BEM methodology.

Nuxt.config.js

Here follows a guide on the most important parts of the nuxt.config.js file.

Internationalization (i18n)

In the i18n object, you can set up the internationalization settings for the project.

Languages

By default, the project comes with English, Swedish, Norwegian, Danish and Finnish. If you are not gonna use all of these languages, you should remove the ones you're not using from the locales array. If you want to add another language, add it to the array and create a new file in the languages folder with the same name as the language code.

nuxt.config.js
  return {
...
i18n: {
...
locales: [
{
code: 'en',
iso: 'en-US',
file: 'en-US.js',
name: 'English',
// Only used if you have multiple markets on DIFFERENT domains (using the DOMAINS env variable)
domain: domainUrls?.en || '',
},
...
],
...

Pages

In the pages object of the i18n object, you can name your routes that you want translated. The key is the name of the route and the value is the translation key.

nuxt.config.js
  return {
...
i18n: {
...
pages: {
'checkout/index': {
en: '/checkout',
sv: '/kassan',
},
...
},
...

The default setup comes with a bunch of translated routes for all the languages. You can remove the ones you're not gonna use.

PWA settings & loading bar

The PWA settings are used to configure the PWA. You can change the name, description and theme color of the PWA. This gives your store the look and feel of your brand. By default this is set from what your channel settings, but you can change it here if you like.

nuxt.config.js
  return {
...
// Loading bar color
loading: {
color: currentChannelSettings.theme['accent-color'],
height: '5px',
},
...
// PWA settings
pwa: {
manifest: {
name: currentChannelSettings.siteName,
short_name: currentChannelSettings.siteName,
description: fallbackMeta.description,
theme_color: currentChannelSettings.theme['accent-color'],
},
...
},
...

Router settings

The router settings are used to configure your routes. This launchpad comes with all the routes you need to get started. Although, you might need to add some own custom routes for your project, and this is where you do it.

nuxt.config.js
  return {
...
router: {
....
extendRoutes(routes, resolve) {
...
routes.push({
name: 'my-custom-page',
path: '/my-custom-path',
component: resolve(__dirname, 'pages/custom/my-page.vue'),
});
}
...

Runtime config (publicRuntimeConfig)

The runtime config is used to set up global variables that can be accessed throughout the application. This is where you set up the most important settings for your store.

Global settings

SettingDescriptionDefault valueType
ralphLogSettings for when to debug log different messages to the console{ onlyInClient: true, all: ralphEnv === 'dev', api: false, events: false, checkout: false, warnings: false }Object
ralphEnvThe environment for your store, by default not used by anything apart from setting ralphLog, but could be usefulprocess.env.RALPH_ENV or prodString
baseUrlThe base URL for your store including https:// and without ending slashprocess.env.BASE_URLString
imageServerThe image server urlprocess.env.IMAGE_SERVERString
authEndpointThe auth endpoint urlprocess.env.AUTH_ENDPOINTString
signEndpointThe sign endpoint urlprocess.env.SIGN_ENDPOINT.replace('{API_KEY}', process.env.API_KEY)String
apiKeyThe API key for your storeprocess.env.API_KEYString
apiEndpointThe API endpoint for your storeprocess.env.API_ENDPOINTString
fallbackChannelIdThe fallback channel ID for your storeprocess.env.FALLBACK_CHANNEL_IDString
fallbackMarketAliasThe fallback market alias for your storeprocess.env.FALLBACK_MARKET_ALIASString
currentChannelSettingsThe settings from config/channel-settings.js with the same id as fallbackChannelId-Object
channelSettingsAll channel settings from config/channel-settings.js-Array
fallbackMarketsAll available markets fetched in config/fallback-data.js-Array
imageSizesAll available image sizes parsed in config/image-sizes.js-Array
useStartPageSet this to true if you want to create a start page for selecting market/language in a multi market setupfalseBoolean
customerServiceEmailThe email for customer service[email protected]String
customerServicePhoneThe phone number for customer service+46 123 23 43 45String
breakpointsThe breakpoints you want to use for your store{ tablet: 768, laptop: 1024, desktop: 1200, desktopBig: 1440 }Object
siteTopThresholdThe threshold in pixels for when siteIsAtTop getter should be true10Number
socialMediaLinksThe social media links for your store, can for example be used to render social media icons for the footer[{ icon: 'facebook', title: 'Facebook', link: 'https://www.facebook.com' }, { icon: 'instagram', title: 'Instagram', link: 'https://www.instagram.com' }]Array
customerTypesToggleSet to true if you want to use the customer types featuretrueBoolean
customerTypesThe customer types you want to use[{ type: 'PERSON', vat: true }, { type: 'ORGANIZATION', vat: false }]Array
routePathsThe route paths setup in config/route-paths.js{category: '/c', brand: '/b', product: '/p', search: '/s', discountCampaign: '/dc', list: '/l'}Object
statesToPersistThe states of the store that you want to persist when page reloades. These states will be saved in a cookie called ralph-persisted-states['favorites', 'customerType', 'vatIncluded', 'list/relocateAlias', 'list/relocatePage']Array

CMS / Widget settings

SettingDescriptionDefault valueType
bannerWidgetPrimaryColorThe primary color for the banner widget#000000String
bannerWidgetSecondaryColorThe secondary color for the banner widget#FFFFFFString
productListWidgetArrowIconNameThe name of the icon to use for the arrow in the product list widgetchevronString
productListRowSizeThe default number of products per row in the product list widget5Number
widgetImageSizesThe images sizes attribute for the different column sizes{ full: '(min-width: 1360px) 1320px, 96vw', half: '(min-width: 1360px) 650px, (min-width: 768px) 47vw, 96vw', third: '(min-width: 1360px) 427px, (min-width: 768px) 31vw, 96vw', quarter: '(min-width: 1360px) 315px, (min-width: 768px) 23vw, 96vw' }Object
widgetImageSizesFullWidthThe images sizes attribute for the different column sizes when the widget area container is set to full width{ full: '100vw', half: '(min-width: 768px) 49vw, 100vw', third: '(min-width: 768px) 33vw, 100vw', quarter: '(min-width: 768px) 24vw, 100vw' }Object

Product lists

SettingDescriptionDefault valueType
productListDefaultSortThe default sorting for product listsLATESTString
productListPageSizeThe default page size for product lists20Number
productListScrollSizeThe number of products to scroll at a time when using the CaProductListSlider{ phone: 2, tablet: 3, laptop: 5, desktop: 5, desktopBig: 6 }Object
showCategoryFilterSet to true if you want to show the category filtertrueBoolean
showCategoryTreeViewFilterSet to true if you want to show the category filter as a tree viewtrueBoolean
showBrandsFilterSet to true if you want to show the brands filtertrueBoolean
showSkuFilterSet to true if you want to show the SKU filtertrueBoolean
showPriceFilterSet to true if you want to show the price filtertrueBoolean
showDiscountFilterSet to true if you want to show the discount filtertrueBoolean
customSortRoutesUse this to override productListDefaultSort for specific routes. Use the name of the route as name. Example: [{name: 'bestsellers', sort: 'MOST_SOLD'}][]Array

Product

SettingDescriptionDefault valueType
productImageRatioThe ratio for the product images1 / 1Number
productStockFewLeftLimitThe few left limit for stock to use in stock status6Number
productSchemaOptionsThe options for the product schema, make sure to change the schemaImageSize to an existing size of your site{ productSkuLabelIsSize: false, productDescriptionField: 'text1', schemaImageSize: '700f700', extraOfferProperties: { itemCondition: 'https://schema.org/NewCondition' } }Object
productShowRelatedSet to true if you want to fetch and show related products on product detail pagefalseBoolean
showProductReviewSectionSet to true if you want to show the product review section on the product detail pagefalseBoolean
showStarsInProductReviewFormSet to true if you want to show the stars in the product review formtrueBoolean
preLoadedProductImageSizesThe image sizes to preload for the product detail page['1000f1000']Array

Checkout

SettingDescriptionDefault valueType
checkout.promoCodesAccept promo codes on checkouttrueBoolean
checkout.shippingAddressAdd option to add separate shipping address when using CaCheckoutInvoicetrueBoolean
checkout.identityNumberAdd option to add identity number when using CaCheckoutInvoicetrueBoolean
checkout.entryCodeAdd option to add entry code when using CaCheckoutInvoicetrueBoolean
checkout.messageAdd option to add message when using CaCheckoutInvoicetrueBoolean
checkout.defaultPaymentIdThe default payment method id23Number
checkout.defaultShippingIdThe default shipping method id, needs to be set when useInternalShipping is set to truenullNumber
checkout.showMultipleMarketsSet to true if you want to show the country selector step in checkouttrueBoolean
checkout.useInternalShippingSet to true if you want to use the internal shipping methodfalseBoolean

Cart

SettingDescriptionDefault valueType
cart.hiddenSkuValuesDont show selected value for sku with these values in cart['-', 'One size']Array
cart.quantityChangerTypeQuantity changer type for items in cart. Options: default, round, stackeddefaultString

User

SettingDescriptionDefault valueType
user.genderShow user gender picker in 'my accounts' settingsfalseBoolean
user.countryShow user country picker in 'my accounts' settingsfalseBoolean

Getting more into detail

Customer Types

If you want to use the customer types feature, you need to enable it and add the customer types. You can also enable or disable the VAT field for each customer type. Add the types you want to use according to set up in merchant center.

Tip

This feature is powerful and can be used to create different customer groups. For example, you can create a customer type for wholesale customers and a customer type for retail customers. You can then use this feature to create different prices for each customer type.

nuxt.config.js
  return {
...
publicRuntimeConfig: {
...
customerTypesToggle: true,
customerTypes: [
{
type: 'Retail',
vat: true
},
{
type: 'Wholesale',
vat: false
}
...

Next step: Working with Components

Now that you have set up your configuration, you can start working with the components in your store. Head over to the Components section to learn more about the components in this launchpad.