Magnolia 6.1 reached end of life on March 31, 2021. This branch is no longer supported, see End-of-life policy.
The Magnolia Commerce Connector Pack modules allow you to connect your external e-commerce solution to Magnolia. You can use e-commerce content within Magnolia as if it were native Magnolia content. The modules provide access to shopping cart management and checkout functionality that directly interacts with your e-commerce solution via REST.
artifactID | Description |
---|---|
| Parent reactor. |
| Provides a default implementation to connect to the commercetools e-commerce solution. |
| Provides a default implementation to connect to the Magento e-commerce solution. |
| Provides the API for the e-commerce add-on. |
| Provides the ecomfn templating functions. |
| Provides the E-commerce app. |
Maven is the easiest way to install the modules. Add the following dependencies to your webapp. All the other necessary dependencies will be brought in automatically:
<dependency>
<groupId>info.magnolia.ecommerce</groupId>
<artifactId>magnolia-ecommerce</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>info.magnolia.ecommerce</groupId>
<artifactId>magnolia-ecommerce-ui</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>info.magnolia.ecommerce</groupId>
<artifactId>magnolia-ecommerce-commercetools-connector</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>info.magnolia.ecommerce</groupId>
<artifactId>magnolia-ecommerce-magento-connector</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>info.magnolia.ecommerce</groupId>
<artifactId>magnolia-ecommerce-templating</artifactId>
<version>1.0</version>
</dependency>
If you use the pre-built jars, note that this module also requires Caffeine by Ben Manes for cache purposes.
This section explains how to configure the connection between the E-commerce module and your external e-commerce solution.
You can create or edit the configuration in the JCR or the File System (YAML) under <module-name>/ecommerces/<definition-name>
.
Before you configure the connection, make sure you know:
The Commerce Connector Pack provides out-of-the-box connectors to commercetools and Magento. If you use another third-party e-commerce solution, you can configure your own connector.
You can add your connection configuration to the connections list (see YAML example line 15) or in the JCR under
<ecommerce-commercetools-connector>/ecommerces/<definition-name>/connections/<connection-name>
.
If you do not want the connection definition to appear in any of the subapps, set the enabled
property (YAML line 3) to false
.
Note that you can write your own commercetools implementation (YAML lines 4-14) or in the JCR under <module-name>/ecommerces/<definition-name>/implementation
to suit your requirements, for example, to use additional features such as cross- and up-selling or custom features such as your own checkout solution.
class: info.magnolia.ecommerce.common.EcommerceDefinition type: commercetools enabled: true implementation: products: all: info.magnolia.ecommerce.commercetools.products.All byId: info.magnolia.ecommerce.commercetools.products.ById byCategoryId: info.magnolia.ecommerce.commercetools.products.ByCategoryId searchByText: info.magnolia.ecommerce.commercetools.products.SearchByText categories: all: info.magnolia.ecommerce.commercetools.categories.All byId: info.magnolia.ecommerce.commercetools.categories.ById byParentCategoryId: info.magnolia.ecommerce.commercetools.categories.ByParentCategoryId byProductId: info.magnolia.ecommerce.commercetools.categories.ByProductId connections: connectionName: enabled: false authUrl: https://demo.commercetools.com parameters: clientId: client_id clientSecret: client_secret_or_path_to_password_manager apiUrl: https://demo.commercetools.com projectKey: project_key
Node name | Value |
---|---|
class |
|
type |
|
enabled | true or false |
implementation | |
products | |
all | info.magnolia.ecommerce.commercetools.products.All |
byId | info.magnolia.ecommerce.commercetools.products.ById |
byCategoryId | info.magnolia.ecommerce.commercetools.products.ByCategoryId |
searchByText | info.magnolia.ecommerce.commercetools.products.SearchByText |
categories | |
all | info.magnolia.ecommerce.commercetools.categories.All |
byId | info.magnolia.ecommerce.commercetools.categories.ById |
byParentCategoryId | info.magnolia.ecommerce.commercetools.categories.ByParentCategoryId |
byProductId | info.magnolia.ecommerce.commercetools.categories.ByProductId |
connections | |
connectionName | |
parameters | |
clientId | <User name for commercetools> |
clientSecret | <Client secret or path to password manager> |
apiUrl | <API URL> |
projectKey | <project_key> |
authUrl | <Authentication URL> |
enabled | true or false |
You can add your connection configuration to the connections list (see YAML example line 15) or in the JCR under <ecommerce-magento-connector>/ecommerces/<definition-name>/connections/<connection-name>
.
If you do not want the connection definition to appear in any of the subapps, set the enabled
property (YAML line 3) to false
.
Note that you can write your own commercetools implementation (YAML lines 4-14) or in the JCR under <module-name>/ecommerces/<definition-name>/implementation
to suit your requirements, for example, to use additional features such as cross- and up-selling or custom features such as your own checkout solution.
class: info.magnolia.ecommerce.common.EcommerceDefinition type: Magento enabled: true implementation: products: all: info.magnolia.ecommerce.magento.products.All byId: info.magnolia.ecommerce.magento.products.ById byCategoryId: info.magnolia.ecommerce.magento.products.ByCategoryId searchByText: info.magnolia.ecommerce.magento.products.SearchByText categories: all: info.magnolia.ecommerce.magento.categories.All byId: info.magnolia.ecommerce.magento.categories.ById byParentCategoryId: info.magnolia.ecommerce.magento.categories.ByParentCategoryId byProductId: info.magnolia.ecommerce.magento.categories.ByProductId connections: connectionName: authUrl: http://demo.magento.com baseUrl: http://demo.magento.com enabled: false credentials: username: user_name password: password_or_path_to_password_manager
Node name | Value |
---|---|
class |
|
type |
|
enabled | true or false |
implementation | |
products | |
all | info.magnolia.ecommerce.magento.products.All |
byId | info.magnolia.ecommerce.magento.products.ById |
byCategoryId | info.magnolia.ecommerce.magento.products.ByCategoryId |
searchByText | info.magnolia.ecommerce.magento.products.SearchByText |
categories | |
all | info.magnolia.ecommerce.magento.categories.All |
byId | info.magnolia.ecommerce.magento.categories.ById |
byParentCategoryId | info.magnolia.ecommerce.magento.categories.ByParentCategoryId |
byProductId | info.magnolia.ecommerce.magento.categories.ByProductId |
connections | |
connectionName | |
credentials | |
password | <Password or path to password manager> |
username | <User name for for Magento> |
authUrl | <Authentication URL> |
baseUrl | <Base URL> |
enabled | true or false |
You can use an Integration Access Token instead of a username and password to connect to Magento.
To do so:
connections: connectionName: authUrl: http://demo.magento.com baseUrl: http://demo.magento.com enabled: true parameters: accessToken: <your-magento-access-token>
These are the properties used to configure a connection to your external e-commerce solution. The properties required vary depending on your external solution (see Required for column in the table below).
Property | Description | Required for |
---|---|---|
| required
| All |
| required Your e-commerce solution: | All |
| required
| All |
connections | All | |
| All | |
| required Authentication URL. | All |
| required Base URL. | All |
| required Shows if the connection is enabled or not: | All |
| Magento | |
| required, unless an access token is used User name for Magento. | Magento |
| required, unless an access token is used Password for Magento or the path to the Magnolia password manager. | Magento |
| All | |
clientId | required User name for commercetools. | commercetools |
clientSecret | required Client secret for commercetools or the path to the Magnolia password manager. | commercetools |
| required API URL. | commercetools |
| required The project_key from commercetools. | commercetools |
| required, unless a username and password is used An access token provided by Magento. | Magento |
This section explains how to view and test the connection between the Magnolia E-commerce add-on module and your external commerce solution using the E-commerce app.
Depending on your external e-commerce solution, the connection information displayed may be:
Click the Test connection button to check the connection configuration is correct. A message appears indicating if the test is successful or not.
Once you've tested your connection, go to the E-commerce tab. You can see the connections you have configured listed with the catalogs they contain.
By default, the content pulled from your external e-commerce solution is updated every 300 seconds (5 minutes). To configure this setting:
/modules/ecommerce/config/cachingDefinition
.invalidateInSeconds
.Alternatively, you can configure the cache setting via YAML:
cachingDefinition: enabled: true invalidateInSeconds: 300