Installation
Front-Commerce applications requires a Front-Commerce module to be installed in Magento2. This guide explains how to install and configure it.
Module compatibility
The Magento2 module is compatible with Magento2 Open Source, Commerce and B2B (see supported versions in our release notes). To use respectively Commerce or B2B specific features, you need to install and setup the Front-Commerce's Magento2 Commerce module or the Front-Commerce's Magento2 B2B module.
Magento 2.4.3 requires an Adobe official patch.
To use Magento >= 2.4.6 you need at least version 2.10.0 of the Front-Commerce Magento2 Module
Install with composer
composer config repositories.front-commerce git git@gitlab.blackswift.cloud:front-commerce/magento2-module-front-commerce.git
composer require front-commerce/magento2-module
bin/magento setup:upgrade
We recommend to use a specific version of this module and not to blindly rely on the latest version.
Configuration
If the installation is successful, in Magento's administration panel, you will see Front-Commerce settings for instance under Stores > Configuration > General > General
Settings to configure the REST API behavior
This can be done by running the following commands:
./bin/magento config:set "webapi/webapisecurity/allow_insecure" "1"
./bin/magento config:set "tax/display/type" "3"
./bin/magento config:set "tax/display/shipping" "3"
Create the API integration
An API integration must be created for Front-Commerce. To do so in the
administration panel, go to System > Extensions > Integrations
create an
integration. In the API section, make sure to set Resource Access to All.
After doing that, configure the tokens in Front-Commerce’s environment variables with the values generated for the integration:
FRONT_COMMERCE_MAGENTO_CONSUMER_KEY
FRONT_COMMERCE_MAGENTO_CONSUMER_SECRET
FRONT_COMMERCE_MAGENTO_ACCESS_TOKEN
FRONT_COMMERCE_MAGENTO_ACCESS_TOKEN_SECRET
Define Front-Commerce URL
In the administration panel, go to System > Custom Variables
and set the value
of the fc_url
variable with the public Front-Commerce public URL (e.g.
http://localhost:4000
)
Define the cache API token
In the administration panel, go to System > Custom Variables
and set the value
of the fc_cache_api_token
variable with a secret value. This value must match
the content of the FRONT_COMMERCE_CACHE_API_TOKEN
environment variable.
Update session lifetime
Only for Magento >= 2.4.4
In the administration panel, go to System > Stores > Configuration
then in the
sidebar, select SERVICES > Magento Web API
.
Then find the JWT Authentication
section and fill the
Customer JWT Expires In
field with the value you want (in minutes).
Ensure it works
To check that the API is properly configured, you can try to request:
http://magento.url/rest/V1/store/storeViews
http://magento.url/rest/V1/frontcommerce/urls/match?urls[]=<url>
where<url>
is one of the URL key of your products
Known issues
Magento 2.4.6: Grouped product options aren't visible
See related issue: https://github.com/magento/magento2/issues/37774
On Magento 2.4.6, Front-Commerce may display a Grouped product with a price of 0€ without any options.
In this version, if products that are part of a grouped product are set to "Not
Visible Individually", they won't be returned by Magento when retrieving the
grouped product along with its options. Instead, the returned option will be an
array of items with product: null
.
This issue isn't present in Magento 2.4.5, and as been fixed in Magento 2.4.7-p1.