commercetools
The module provides integration of a Drupal website with commercetools to make product catalogs from commercetools available in Drupal pages through commercetools API.
Also, it allows to form orders on the Drupal side and transfer them to the commercetools for further processing.
It provides two approach to render products from commercetools via submodules:
commercetools_content
- coupled approach:
The module gets the products from commercetools on the backend and renders them using Twig templates on the backend too.
commercetools_decoupled
- decoupled approach:
The module provides frontend Web Components that load products on the browser side from commercetools API and render them. The Web Components made using Drupal Single Directory components approach to simplify altering and replacing them in Drupal themes and modules.
Also, provided Web Components can be reused in the Single Page Applications with React, Vue.js, Angular, etc.
The module provides a build-in demonstration in the commercetools_demo
module,
that automatically preconfigures a fully functional eCommerce solution out of
the box.
commercetools_demo
- API Credentials
The API credentials used in the commercetools_demo module are configured with minimal permissions to support demonstration purposes. These permissions ensure that the demo setup can showcase the core functionalities while maintaining security.
The demo credentials are only for demonstration purposes. If you are setting up a real eCommerce site, you need to configure your own commercetools API client with the appropriate permissions based on your business requirements.
Requirements
The commercetools_decoupled
requires the
Single Directory Components [sdc
] Drupal
module, that is available only from Drupal 10.1 and marked as experimental up to
10.2.x, in Drupal 10.3.x the sdc
is stable already.
Installation
Install it just as a regular Drupal Module, for Drupal lower than 10.3.0 you
should agree on installing the experimental sdc
module.
Then, you should enter your commercetools credentials in the module settings: Client ID, Client secret, Default project ID, and that's it.
The main module commercetools
just provide a proxy to the commercetools API
with Drupal-specific checks, and no user interface for the end users.
So, to get the end user UI you should install one of the UI modules:
commercetools_content
or commercetools_decoupled
.
Then, the list of products will be available on the /catalog
(coupled) or
/products
(decoupled) path.
The default templates uses Bootstrap classes for design, so to make them look well - include the Bootstrap library or install any of the Bootstrap themes for Drupal:
- https://www.drupal.org/project/bootstrap_barrio
- https://www.drupal.org/project/bootstrap5
- https://www.drupal.org/project/ui_suite_bootstrap
- https://www.drupal.org/project/radix
- https://www.drupal.org/project/bootstrap
Configuration
The module configuration is available in the admin menu:
Configuration » commercetools [/admin/config/system/commercetools
].
Maintainers
Branding Note on "commercetools"
Throughout this module, "commercetools" is intentionally rendered in all lowercase within the UI. This decision aligns with the official branding guidelines of commercetools, which specify their name should appear in lowercase across all partner implementations.