> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shared Catalogs

> Learn how the Algolia AI Search & Discovery extension interacts with the Adobe Commerce Shared Catalogs feature.

export const Records = () => <Tooltip tip="A record is a searchable object in an Algolia index. Each record consists of named attributes." cta="Algolia records" href="/doc/guides/sending-and-managing-data/prepare-your-data#algolia-records">
    records
  </Tooltip>;

Shared Catalogs are part of the [Adobe Commerce B2B features](https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/install).
The feature lets you maintain catalogs with custom prices for different companies.
For more information, see [Adobe's documentation](https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/shared-catalogs/catalog-shared).

## Enable Shared Catalogs

1. In your store's Admin, go to **Stores > Settings > Configuration > General > B2B Features**.
2. Set **Enable Company** to **Yes**.
3. Set **Enable Shared Catalog** to **Yes**.

Once the feature is enabled,
the Algolia extension automatically adds the `catalog_permissions` attribute to product and category <Records />.

<Note>
  Enabling the Shared Catalogs feature significantly increases the size of your records (specifically, the `price` attribute).
  If you have complex category permissions or intend to have many shared catalogs,
  assess the impact on your product indices before enabling the feature.
</Note>

## Customer groups

Adobe Commerce and Magento Open Source create a customer group for each shared catalog.

This example shows the creation of two shared catalogs: one for small businesses and another for franchises.

<img src="https://mintcdn.com/algolia/euPPm2cRVTf92uwA/doc/integration/magento-2/how-it-works/shared-catalogs-grid.png?fit=max&auto=format&n=euPPm2cRVTf92uwA&q=85&s=388d6cebcbf6e9c6c3a410cde18c31a1" alt="Screenshot of a 'Shared Catalogs' page with a table of three records and an 'Add Shared Catalog' button." width="3214" height="928" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-grid.png" />

You'll also find two more customer groups listed on the **Customers > Customer Groups** page.

<img src="https://mintcdn.com/algolia/6YAuCqOjAR64l9hZ/doc/integration/magento-2/how-it-works/shared-catalogs-customer-groups.png?fit=max&auto=format&n=6YAuCqOjAR64l9hZ&q=85&s=c36683c1ede5b38158d04c48ca10db53" alt="Screenshot of a 'Customer Groups' grid showing six records with columns for ID, Group, Tax Class, and Action." width="3192" height="1154" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-customer-groups.png" />

## Companies

Adobe's B2B features include [companies](https://experienceleague.adobe.com/en/docs/commerce-admin/b2b/companies/account-companies)
which lets you associate shared catalogs with a group of users.

To associate the users from a company with the corresponding shared catalog:

1. On the company page in your Admin, go to **Advanced Settings**.
2. Link a shared catalog to the company.

<img src="https://mintcdn.com/algolia/6YAuCqOjAR64l9hZ/doc/integration/magento-2/how-it-works/shared-catalogs-companies.png?fit=max&auto=format&n=6YAuCqOjAR64l9hZ&q=85&s=441d24010ef996f54c5225880c21f56d" alt="Screenshot of a drop-down menu in the 'Customer Group' field showing options like 'Retailer,' 'Wholesale,' and 'B2B (Small Business).'" width="2258" height="1298" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-companies.png" />

## Algolia indexing with Shared Catalogs enabled

Each customer group generates an [additional replica](/doc/integration/magento-2/how-it-works/indexing#number-of-records-created) for product indices.
The number of replicas per customer group depends on the sorting options you've configured.

<img src="https://mintcdn.com/algolia/euPPm2cRVTf92uwA/doc/integration/magento-2/how-it-works/shared-catalogs-replicas.png?fit=max&auto=format&n=euPPm2cRVTf92uwA&q=85&s=efbf13282fcc009741ae4a3eb0cbccf6" alt="Screenshot of a list of replica indices with names like 'magento246ee_default_products_price_group_0_asc' and similar entries, each with a link icon." width="1938" height="894" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-replicas.png" />

For more information, see [Understanding the Algolia replica configuration](/doc/integration/magento-2/troubleshooting/back-end-issues#understand-the-algolia-replica-configuration).

### How pricing is handled by Shared Catalogs

Customer group replicas control how shared catalog pricing is sorted, just like with other replicas.

According to the Adobe Commerce and Magento Open Source [group pricing feature](https://experienceleague.adobe.com/en/docs/commerce-admin/catalog/products/pricing/product-price-group), any custom price set for a shared catalog also applies to its customer group and its replicas.

### Product visibility with Shared Catalogs

Algolia's extension adds the `catalog_permissions` attribute to product and category records.
This attribute assigns a boolean value to each customer group.
The value determines if the item is visible on the frontend.

Manage these permissions in your Admin under **Catalog > Shared Catalogs**.

<img src="https://mintcdn.com/algolia/6YAuCqOjAR64l9hZ/doc/integration/magento-2/how-it-works/shared-catalogs-attribute.png?fit=max&auto=format&n=6YAuCqOjAR64l9hZ&q=85&s=e081c00622067f431bce3ee34ee2861e" alt="Screenshot of a code snippet showing catalog permissions data with customer_group_0 to customer_group_7 keys and their boolean values." width="856" height="398" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-attribute.png" />

<Check>
  If you add, edit, or delete a shared catalog, run a full reindex for products and categories.
</Check>

For products and categories not assigned to a shared catalog (such as **NOT LOGGED IN** and **Default** customer groups),
products are shown or hidden based on default catalog permissions.

### Default catalog permissions

The visibility of products and categories that aren't associated with a shared catalog relies on your **Category Permissions** settings.

<img src="https://mintcdn.com/algolia/6YAuCqOjAR64l9hZ/doc/integration/magento-2/how-it-works/shared-catalogs-category-page.png?fit=max&auto=format&n=6YAuCqOjAR64l9hZ&q=85&s=fa7c8c71c0445ecb00258fb9c549f599" alt="Screenshot of 'Category Permissions' table with 'Main Website' and 'NOT LOGGED IN' settings, showing 'Browsing Category,' 'Display Product Prices,' and 'Add to Cart' options." width="3202" height="1364" data-path="doc/integration/magento-2/how-it-works/shared-catalogs-category-page.png" />

After any permission updates, reindex all affected products and categories.

To apply custom logic to the `catalog_permissions` attribute settings,
use **update attribute data** [backend events](/doc/integration/magento-2/customize/custom-back-end-events#update-attribute-data).
