Integrations / Platforms / Magento 2 / Dispatched Back-End Events

Dispatched Back-End Events

We provide events so developers can customize the behavior of their extension. We utilize Magento’s dispatched events convention for our hooks.

You can learn how to create listeners on custom events in a custom extension in Create a custom extension tutorial.

Products

Dispatching before pushing products’ index settings to Algolia

algolia_products_index_before_set_settings

Passed parameters:

  • $storeId
  • $index_settings as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $index_settings as data in Magento\Framework\DataObject object

Dispatching after products collection creation

algolia_after_products_collection_build

Passed parameters:

  • $storeId
  • $collection as Magento\Catalog\Model\ResourceModel\Product\Collection
  • $only_visible
  • $include_not_visible_individually

Modifiable parameters:

  • $collection as Magento\Catalog\Model\ResourceModel\Product\Collection

Dispatching before final products collection load

algolia_before_products_collection_load

Passed parameters:

  • $collection as Magento\Catalog\Model\ResourceModel\Product\Collection
  • $store

Modifiable parameters:

  • $collection

Dispatching before fetching product’s attributes for indexing

algolia_product_index_before

Passed parameters:

  • $product as Magento\Catalog\Model\Product
  • $custom_data as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $custom_data as data in Magento\Framework\DataObject object

Dispatching after fetching product’s attributes for indexing

algolia_after_create_product_object

Passed parameters:

  • $custom_data as data in Magento\Framework\DataObject object
  • $subProducts as array of sub products
  • $productObject as Magento\Catalog\Model\Product

Modifiable parameters:

  • $custom_data as data in Magento\Framework\DataObject object

Categories

Dispatching before pushing categories’ index settings to Algolia

algolia_categories_index_before_set_settings

Passed parameters:

  • $storeId
  • $index_settings as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $index_settings as data in Magento\Framework\DataObject object

Dispatching after categories collection creation

algolia_after_categories_collection_build

Passed parameters:

  • $store
  • $collection as Magento\Catalog\Model\ResourceModel\Category\Collection

Modifiable parameters:

  • $collection

Dispatching before fetching category’s attributes for indexing

algolia_category_index_before

Passed parameters:

  • $category as Magento\Catalog\Model\Category
  • $custom_data as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $custom_data as data in Magento\Framework\DataObject object

Dispatching after fetching category’s attributes for indexing

algolia_after_create_category_object

Passed parameters:

  • $category as Magento\Catalog\Model\Category
  • $categoryObject as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $categoryObject as data in Magento\Framework\DataObject object

Pages

Dispatching before pushing pages’ index settings to Algolia

algolia_pages_index_before_set_settings

Passed parameters:

  • $store_id
  • $index_settings as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $index_settings as data in Magento\Framework\DataObject object

Dispatching after fetching page’s attributes for indexing

algolia_after_create_page_object

Passed parameters:

  • $page as data in Magento\Framework\DataObject object
  • $pageObject as Magento\Cms\Model\Page

Modifiable parameters:

  • $page as data in Magento\Framework\DataObject object

Suggestions

Dispatching before pushing suggestions’ index settings to Algolia

algolia_suggestions_index_before_set_settings

Passed parameters:

  • $store_id
  • $index_settings as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $index_settings as data in Magento\Framework\DataObject object

Dispatching after suggestions collection creation

algolia_after_suggestions_collection_build

Passed parameters:

  • $store
  • $collection as Magento\Search\Model\ResourceModel\Query\Collection

Modifiable parameters:

  • $collection

Dispatching after fetching suggestion’s attributes for indexing

algolia_after_create_suggestion_object

Passed parameters:

  • $suggestion as data in Magento\Framework\DataObject object
  • $suggestionObject as Magento\Search\Model\Query

Modifiable parameters:

  • $suggestion as data in Magento\Framework\DataObject object

Additional sections

Dispatching before pushing additional sections’ index settings to Algolia

algolia_additional_sections_index_before_set_settings

Passed parameters:

  • $store_id
  • $index_settings as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $index_settings as data in Magento\Framework\DataObject object

Dispatching after fetching additional_section’s attributes for indexing

algolia_additional_section_items_before_index

Passed parameters:

  • $section
  • $record as data in Magento\Framework\DataObject object
  • $store_id

Modifiable parameters:

  • $record as data in Magento\Framework\DataObject object

Front-end configuration

Dispatching after front-end configuration creation

algolia_after_create_configuration

Passed parameters:

  • $configuration as data in Magento\Framework\DataObject object

Modifiable parameters:

  • $configuration as data in Magento\Framework\DataObject object

Did you find this page helpful?