Log in
Model

AbstractIndex

Magento\Reports\Model\Product\Index\AbstractIndex

What it does

This abstract base class manages product tracking indexes in Magento 2's Reports module, used for features like recently viewed products, product comparisons, and wishlists.

Developers extend this class to create specific product index types (e.g., RecentlyViewed, Compared) that track product interactions for visitors and customers, automatically handling session management, customer login/logout scenarios, and cleaning old visitor data.

Public Methods

  • beforeSave()
  • getVisitorId()
  • getCustomerId()
  • getStoreId()
  • updateCustomerFromVisitor()
  • purgeVisitorByCustomer()
  • calculate()
  • getExcludeProductIds()
  • getCount()
  • clean()
  • registerIds()