Requirements
Before you start, check that you have:- the Littlebox Strapi Suite plugin installed in your Strapi project;
- access to the server environment, so you can set the environment variables listed below and restart Strapi;
- a storefront (your public website) that calls the storefront API. You can build it however you like. See the frontend guide.
- Stripe to take card, MB WAY and other online payments;
- Moloni to issue certified invoices and credit notes;
- DPD Portugal and CTT Expresso Portugal to create shipments with a carrier;
- Resend to send e-mails to your customers.
Turn the module on
Step 1: Access the Strapi admin panel.Step 2: Go to the Littlebox Strapi Suite and select “E-commerce”. You can also click the “Littlebox Strapi Ecommerce” shortcut in the main menu of Strapi.
Step 3: The screen shows “The E-commerce module is disabled”. Click “Enable E-commerce”. The module opens on the product list. Its side menu has these entries:
- Products: the catalog, with variants, prices, stock and images.
- Categories: the tree that organizes the products.
- Collections: groups of products, chosen by hand or by conditions.
- Tags: free labels for the products.
- Orders: every order, from the storefront or created by you.
- Customers: the people who bought or registered.
- Promotions: discounts, codes and gifts. It only shows when you can read promotions.
- Settings: the store, the API, the integrations, the e-mails and the scheduled jobs.
Turn the module off
Step 1: Go to “Settings” and open the “General” tab.Step 2: In the “E-commerce module” card, click “Disable”.
Step 3: Confirm. While the module is off, the store is closed:
- every e-commerce endpoint, in the admin and in the storefront API, answers
404 Not Found, so the site cannot show products or take orders; - Stripe payment notifications also get
404, and Stripe retries them for up to 3 days; - the module only shows the screen to turn it back on.
Environment variables
The module keeps secrets (integration passwords, API keys, customer passwords) safe with two kinds of server keys. You set them in the environment of the Strapi server, for example in the.env file, and then you restart Strapi.
Generate each value with this command. It prints at least 32 random bytes in base64, which is the minimum for a pepper:
.env
You can also set the encryption key in the plugin configuration as
ecommerce.encryptionKey. When both exist, the
plugin configuration wins.The General tab shows “The encryption key is not configured”. Everything else keeps working, but you cannot save integration credentials, and customer accounts are not available. Without a pepper
The module still starts. If you choose a customer accounts mode other than guest only, the General tab shows “Customer accounts are not ready yet”, and customers cannot sign in. Rotate the pepper
To change the pepper, add a new version, for example
LTB_ECOMMERCE_PASSWORD_PEPPER_V2, and keep V1 as it is. The
highest number is the current version. Each customer password moves to the new version the next time that customer
signs in. Keep the old versions set until no password uses them.