Install the B2B for Adobe Commerce extension
The B2B for Adobe Commerce extension is only available for Adobe Commerce v2.2.0 or later. It is installed after installing Adobe Commerce.
Install the most recent version of the B2B extension that is supported on the deployed Adobe Commerce version.
Requirements
-
Adobe Commerce version 2.3.x or later
-
Valid authentication keys to download Adobe Commerce extensions.
Save authentication keys for installation by defining them globally in your COMPOSER_HOME directory. Or, save them to an auth.json file in the Adobe Commerce application root directory.
Before installing or upgrading the B2B extension, check the release notes for the most current information about version compatibility, updates, or changes that can affect installation or upgrade requirements.
Installation steps
-
From the Adobe Commerce application root directory, update the
composer.json
to add the dependencies for the B2B extension:code language-bash composer require magento/extension-b2b:<version>
If an error occurs, for example:
code language-terminal [InvalidArgumentException] Could not find a matching version of package magento/extension-b2b.
Check the package spelling, your version constraint, and that the package is available and matches your minimum-stability (stable) requirement.
-
If prompted, enter your authentication keys.
Your public key is your username; your private key is your password. If you have stored your public and private keys in
auth.json
, you are not prompted to authenticate. -
Run the following commands after Composer finishes updating modules:
code language-bash bin/magento setup:upgrade
code language-bash bin/magento setup:di:compile
code language-bash bin/magento setup:static-content:deploy -f
code language-bash bin/magento cache:clean
note note NOTE In Production mode, you might receive a message to Please rerun Magento compile command
. Enter the commands to complete the installation. Adobe Commerce does not prompt you to run the compile command in Developer mode.
After completing the installation, configure and start message consumers, including specifying parameters for message consumers.
Message consumers
The B2B for Adobe Commerce extension uses MySQL for message queue management. The following table lists the message consumers that support B2B capabilities. After you install the extension, start the message consumers for the B2B capabilities required for your Commerce storefront.
sharedCatalogUpdatePrice
sharedCatalogUpdateCategoryPermissions
negotiableQuotePriceUpdate
purchaseorder.toorder
purchaseorder.transactional.email
purchaseorder.validation
quoteItemCleaner
inventoryQtyCounter
async.operations.all
Configure message consumers
Prevent possible processing issues or delays by adding the following parameters when you start the message consumers for B2B capabilities.
-
--max-messages <value>
— Specifies the maximum number of messages each consumer must process before terminating (default = 10000). Although we do not recommend it, you can use 0 to prevent the consumer from terminating. The best practice for a PHP application is to restart long-running processes to prevent possible memory leaks. -
--batch-size <value>
— Allows you to limit the system resources consumed by the consumers (CPU, memory). Using smaller batches reduces resource usage and, thus, leads to slower processing. If specified, messages in a queue are consumed in batches of<value>
each. This option is applicable for the batch consumer only. If--batch-size
is not defined, the batch consumer receives all available messages in a queue.
For information about additional configuration options, see Specific-configuration.
Start message consumers
To enable asynchronous operations for B2B capabilities, you must start multiple message consumers.
-
List the available message consumers:
code language-bash bin/magento queue:consumers:list
The command returns available message consumers including all B2B message consumers.
-
Start each consumer separately:
code language-bash bin/magento queue:consumers:start [--max-messages=<value>] [--batch-size=<value>] <consumer_name>
For example:
code language-bash bin/magento queue:consumers:start quoteItemCleaner
&
to the command, return to a prompt, and continue running commands. For example: bin/magento queue:consumers:start sharedCatalogUpdatePrice &
.For more information, see Manage message queues in the Configuration Guide.
Add message consumers to cron
You have the option to automate the run schedule for the SharedCatalogUpdateCategoryPermissions
and SharedCatalogUpdatePrice
message consumers by adding the schedule to the cron configuration file /app/code/Magento/MessageQueue/etc/crontab.xml.
* * * * * ps ax | grep [s]haredCatalogUpdateCategoryPermissions >>/dev/null 2>&1 || nohup php /var/www/html/magento2/bin/magento queue:consumers:start sharedCatalogUpdateCategoryPermissions &
* * * * * ps ax | grep [s]haredCatalogUpdatePrice >>/dev/null 2>&1 || nohup php /var/www/html/magento2/bin/magento queue:consumers:start sharedCatalogUpdatePrice &
You can also configure schedules for message consumers from the Store Configuration settings in the Admin.
Enable B2B features in the Admin
After installing the B2B for Adobe Commerce extension and starting message consumers, you must also enable B2B features in the Admin.